function myFunction{
Utilities.sleep(1000);
var a=UrlFetchApp...
// Other stuff
}
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/e51a4c81-ac7a-4e57-85a5-1618bb59ba56%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.
Maybe you can do something like :
var cache = CacheService.getScriptCache()if(cache.get("CachedData")==null){Utilities.sleep(100)
if(cache.get("CachedData")==null){//Fetch data but first set cachecache.put("CachedData","Fetching",10000)var data = UrlFetchApp.fetch("https://secret.data/server")
//If after 10 seconds the fetch hasn't finished another server will take care of it so if the fetching failed not everything fails.cache.put("CachedData",data,1000*60*10)
}}while(true){if(cache.get("CachedData")=="Fetching"){
Utilities.sleep(100)}else{break;}
if(cache.get("CachedData")==null){