Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to cancel an UrlFetchApp.fetch after specified time?

When using UrlFetchApp.fetch in a loop there are some URLs that take much longer than others and fail.

  • Is there any way to cancel or break out of the loop before the fetch erros out?
  • Does UrlFetchApp.fetch has a timeout parameter?

Any ideas?

like image 774
Luciano Avatar asked Oct 02 '13 11:10

Luciano


1 Answers

There is no good way to do this. We do not have a way to specify a timeout in the UrlFetchApp HTTP call params - https://developers.google.com/apps-script/reference/url-fetch/url-fetch-app#fetch(String,Object)

You should log an enhancement request in the Issue Tracker with details of your use case - https://code.google.com/p/google-apps-script-issues/issues/list

like image 104
Arun Nagarajan Avatar answered Nov 04 '22 02:11

Arun Nagarajan