Service invoked too many times for one day: urlfetch

后端 未结 2 472
太阳男子
太阳男子 2021-01-22 02:52

I am getting the following error in my Sheets Add-on:

Service invoked too many times for one day: urlfetch

I\'m aware of the limits here, but h

相关标签:
2条回答
  • 2021-01-22 03:48

    You currently can not do it.

    Perhaps run a counter in your script.

    0 讨论(0)
  • 2021-01-22 03:50

    I have run into that too. I only have 1000 rows going out to a web service. Data did not change neither in my sheet nor in the service. But at some point today most of my cells show #Error with this cause.

    I feel like it's going out to re-fetch the results way too often. Is there not some caching that can be employed?


    UPDATE (long time due): adding cache was exactly what was needed. So I implemented a function fetch(url) which uses a cache and that way avoids the replicate calls.

    function fetch(url) {
      var cache = CacheService.getScriptCache();
      var result = cache.get(url);
      if(!result) {
        var response = UrlFetchApp.fetch(url);
        result = response.getContentText();
        cache.put(url, result, 21600);
      }
      return result;
    }
    
    0 讨论(0)
提交回复
热议问题