0

My Google script, which I'm runnig from script.google.com invokes a PHP script on a remote server. This PHP script works for a few minutes, maybe more.

How much time can the Google script wait for a response from server?

Tunaki
  • 132,869
  • 46
  • 340
  • 423
Artem Chernov
  • 856
  • 2
  • 8
  • 26
  • note that a trivial google search for "apps script time limit" takes you to the linked answer and many others. – Zig Mandel Sep 28 '15 at 13:29

2 Answers2

0

Check this advice from Google.

We do not increase script execution times on a per-domain basis. There are ways for you to accomplish your use-case without any increases, however. Instead of trying to do everything in one script's execution time, use a sequence of script executions (using triggers) to process batches of the overall job. You can use ScriptDB or another persistent datastore to keep track of the documents processed, and each subsequent triggered execution can read from this and pick up processing where the previous execution left off.

Jerome Anthony
  • 7,823
  • 2
  • 40
  • 31
  • i know, but i want know allowed time for waiting time in script.google.com. may a google not allowed a long time request – Artem Chernov Sep 28 '15 at 08:56
  • @LeoKomarov Just a note, ScriptDB has already Sunset, you can store in PropertiesService tough. – Kriggs Sep 28 '15 at 12:34
  • @Kriggs i don`t store data, i just created two triggers for my task, and running them one by one. First trigger send request to server, a php script does your job and saved data to file. Second trigger run after a hour and grab data from server. – Artem Chernov Sep 28 '15 at 13:18
  • this does not answer the question and mentions services thst no longer exist. – Zig Mandel Sep 28 '15 at 13:26
0

Better than "waiting" for the response, is making the PHP call a new function on GAS (sorta like a callback), to do this publish your GAS with the options "As me" and "Anyone, even anonymous". Then you can call the /exec link with Get/Post parameters and continue executing the function.

This is ofcourse if your editor on the PHP page.

Kriggs
  • 3,731
  • 1
  • 15
  • 23