Fix negative sleep time

This commit is contained in:
glax 2023-05-22 21:41:11 +02:00
parent 9a640aed27
commit a71d65e666

View File

@ -205,6 +205,7 @@ public abstract class Connector
TimeSpan rateLimitTimeout = _rateLimit[requestType] TimeSpan rateLimitTimeout = _rateLimit[requestType]
.Subtract(DateTime.Now.Subtract(_lastExecutedRateLimit[requestType])); .Subtract(DateTime.Now.Subtract(_lastExecutedRateLimit[requestType]));
if(rateLimitTimeout > TimeSpan.Zero)
Thread.Sleep(rateLimitTimeout); Thread.Sleep(rateLimitTimeout);
HttpResponseMessage? response = null; HttpResponseMessage? response = null;