Current middleware just waits a random time on each query except files requests. Here it a better idea. Keep a map of (RequestType, CallInfo). CallInfo represents sliding window of calls with size about 1 minute. If we got FloodException then we can count how much requests can be made and calculate delay.
Current middleware just waits a random time on each query except files requests. Here it a better idea. Keep a map of (RequestType, CallInfo). CallInfo represents sliding window of calls with size about 1 minute. If we got FloodException then we can count how much requests can be made and calculate delay.