0

I'm not sure if I have encountered with a bug or is just me not fully understanding how triggers work, probably the second one :D.

I have a google apps script that collects information through a series of requests to our CRM's API and puts it on a Google Docs Spreadsheet, the script takes a while to run, however, it runs successfully (I run it manually every morning, takes about 3 minutes). But when I try to automate that task, I get an error message saying my script exceeded its execution time limit.

I tried setting up my triggers manually, creating them within the script, breaking down my script reducing the number of API requests (taking less then a minute to execute) and execute it several times so I get the whole information. Every single time I get the same error message.

Am I missing something here? Any help will be much appreciated!

Edit: The mail I received has this error message: "Exceeded maximum execution time".

Edit2: I was able to fix this (party). I came across the answer for this question Exceeded maximum execution time in Google Apps Script and worked like a charm.

Rubén
  • 34,714
  • 9
  • 70
  • 166
JavAmco
  • 26
  • 2

2 Answers2

0

There are some limits to Google Apps Scripts that you must keep in mind: see Quotas.

It is possible that you are exceeding your total runtime for Triggers. There is also the shorter individual execution time limits on Triggers. I think I remember reading somewhere that Triggers have a lower total execution time limit per execution, but I can't remember where I saw it, and I can't find a source, even in Google's documentation.

This SO question is also similar...

Community
  • 1
  • 1
Chris Cirefice
  • 5,475
  • 7
  • 45
  • 75
0

I wouldn't say it's a bug, however as my own painfully experience, I can tell it's not the same running the script manually than through a time-driven trigger. Sometimes it's just slower, but others it fails for timeout.

I don't know your specifics (there is no code available), but I would recommend you to use a retry exponential backoff function wrapping any critical call and also check for a timeout warning (let's say at 5 minutes) within the main loop.

Fausto R.
  • 1,314
  • 3
  • 16
  • 29
  • Hi Fausto, thank you for your response. Could you explain me a little more this exponential backoff function wrapping approach? – JavAmco Dec 04 '13 at 15:26