Closed FlickeringIRoam closed 6 years ago
A better way of doing this is to work out how many seconds you would have to wait per call to never be under the limit. This ensures that you'll not have a long period of being unable to send a request. A second is a long time to block.
That wouldn't really work, since it's not a per-call limit, it's a per-account limit. If we know how many we're going to need per "run" then we could wait and reserve that amount beforehand, but in general, this limit shouldn't really be hit, if it is, we're probably not being picky enough with our selection. However, there IS a issue with it, in that it will always wait if we just pass 30 calls, not matter how distant. I'll fix it at some point, this was just a quick fix to address an immediate concern.
I'm testing this now. Seems to be working so far.
if number of requests tracked > 30, then trim it down to the calls in the last 60s, and wait until we're under the limit.