Delay between Fetch Calls executed within a loop

#1

Some of our end users are experiencing a 401 unauthorized response when running fetch calls within a loop.

I would like to know if there’s a recommended duration for delay after each iteration of the loop to avoid this scenario.

I have confirmed via impersonation that their OAuth token works and the permissions are in place to retrieve the data. The end users have also confirmed such behavior on their end.

Thanks.

#2

Can i see the code? This looks like a clear bug…

As an aside, you might want to try a MapReduce or Batch job instead of running a long loop. They can be much more efficient.