在循環中使用UrlFetchApp.fetch時,會有一些URL比其他URL花費更長的時間並失敗。如何在指定時間後取消UrlFetchApp.fetch?
- 在提取錯誤之前,有什麼辦法可以取消或跳出循環嗎?
- UrlFetchApp.fetch是否有超時參數?
任何想法?
在循環中使用UrlFetchApp.fetch時,會有一些URL比其他URL花費更長的時間並失敗。如何在指定時間後取消UrlFetchApp.fetch?
任何想法?
有沒有好辦法做到這一點。我們沒有辦法來指定在UrlFetchApp
HTTP調用PARAMS超時 - https://developers.google.com/apps-script/reference/url-fetch/url-fetch-app#fetch(String,Object)
你應該和你的使用情況的詳細記錄在問題追蹤器的增強請求 - https://code.google.com/p/google-apps-script-issues/issues/list
我有同樣的問題,該解決方案使用muteHttpExceptions。
var opt ={
"validateHttpsCertificates" : false,
"muteHttpExceptions" : true
};
UrlFetchApp.fetch(url, opt);
在超時過期後,如何設置'muteHttpExceptions'幫助取消'fetch()'操作? – kiwidrew
這在應用程序腳本問題跟蹤有人提出在2014年4月,但仍然沒有得到解決:https://code.google.com/p/google-apps-script-issues/issues/detail ?id = 3908 – kiwidrew