3

Since last week when I try to request and fetch results on ScriptDB I get this error : "Service invoked too many times in a short time: scriptdb rateMax. Try Utilities.sleep(1000) between calls. (line XXX)"

Below, a small sample script that reproduces the issue:

var result = db.query({key:value});
while (result.hasNext()) {
    var current = result.next();

    if(current.someProperty == true) {
      objectsToRemove.push(current);
   }          
}

I tried to add calls to "Utilities.sleep(1000)" before / after the line where the error occured but it didn't change anything.

Thanks by advance.

arnaud.breton
  • 2,054
  • 1
  • 24
  • 39

2 Answers2

0

Nobody meet this issue ?

I optimize my Call to DB but I have to make my script sleeping during 1,5 second to avoid this error, which is resulting in a timeout of my script...

arnaud.breton
  • 2,054
  • 1
  • 24
  • 39
  • So did you solve this issue? I have the exact same problem :( I thought that this is due to scriptdb depreation. I have a question about it here: http://stackoverflow.com/questions/24033530/how-to-replace-the-deprecated-scriptdb-with-mongodb-using-url-fetch-service – Stas Jun 04 '14 at 10:31
  • Sorry, I'm not working on this project anymore, can't help you! – arnaud.breton Jun 04 '14 at 15:18
0

Try clearing out your database before trying to run this code. You may have too many duplicates and that is why is going over the limit or try to divide your query in parts to make the process easier and avoid the error.

Hector S.
  • 303
  • 3
  • 12