1

The 2 jobs run fine independently, however when I run them both under 1 job (MONTHLY_BUDGET), i get the following error: "Exceeded maximum execution time".

How can i exceed the execution time for the following:

function MONTHLY_BUDGET(){

  BudgetMetric_ActivityDays();
  BudgetMetric_GrossRevenue();

  }


function Weekly_BudgetMetric_ActivityDays(){ 

  var sheetName = "Weekly Budget (Blended)";
  var sql = ' SQL ';
   var ranges = ["wkmbddate","wkmbd1","wkmbd2","wkmbd3","wkmbd4","wkmbd5","wkmbd6","wkmbd7","wkmbd8","wkmbd9","wkmbd10"];
   GSReport.runQueryAndInputData(sheetName, sql, ranges, 0);
}


function Weekly_BudgetMetric_GrossRevenue(){ 

  var sheetName = "Weekly Budget (Blended)";
  var sql = ' SQL ';
   var ranges = ["wkbmgdate","wkbmg1","wkbmg2","wkbmg3","wkbmg4","wkbmg5","wkbmg6","wkbmg7","wkbmg8","wkbmg9","wkbmg10"];
   GSReport.runQueryAndInputData(sheetName, sql, ranges, 0);
}
rryanp
  • 1,027
  • 8
  • 26
  • 45

1 Answers1

1

Check this answer on how to add a time trigger. That way you can submit the queries in one execution, and check for their results on a different one:

Google app script timeout ~ 5 minutes?

Community
  • 1
  • 1
Felipe Hoffa
  • 54,922
  • 16
  • 151
  • 325
  • Sorry i dont understand, I can't seem to see the answer in the other thread? – user2550621 Feb 13 '14 at 13:41
  • basically: instead of running one script, run two.. one to kick off the jobs, the other to read the answer (if you are expecting the jobs to take more than 5 minutes - not sure why it takes 5 minutes anyway/) – Felipe Hoffa Feb 13 '14 at 18:03
  • Hi, Thanks... I understand that however I was hoping to limit to one job so we only require 1 trigger. – user2550621 Feb 14 '14 at 16:52