BorisD
BorisD

Reputation: 1814

Google App Script URLFetchApp.fetch timeout

How to overide max timeout in Google App Script using the URL Fetch Service?

function onOpen() {
  
  var url = "myurl.com/longprocess";
  var functionResponse = UrlFetchApp.fetch(url);

}

Upvotes: 2

Views: 671

Answers (1)

ziganotschka
ziganotschka

Reputation: 26796

Currently this is not possible

There is already a popular feature request for it. You can "start" it to increase visibility and hopefully accelerate the implementaiton.

Until then:

  • Implement a try...catch statement and try the request again if it times out
  • If the URL you fetch supports a callback argument, then you can deploy your script as a WebApp. You then ping your API to make the request, and once these are ready the API could send them back to your WebApp.

Upvotes: 1

Related Questions