mirror of
https://github.com/JKorf/CryptoExchange.Net.git
synced 2026-08-21 21:33:01 +00:00
Fix for ratelimiting possibly creating negative waits
This commit is contained in:
@@ -97,7 +97,10 @@ namespace CryptoExchange.Net.RateLimiting.Trackers
|
||||
private TimeSpan DetermineWaitTime()
|
||||
{
|
||||
var checkTime = DateTime.UtcNow;
|
||||
return (_nextReset!.Value - checkTime) + _fixedWindowBuffer;
|
||||
var result = (_nextReset!.Value - checkTime) + _fixedWindowBuffer;
|
||||
if (result < TimeSpan.Zero)
|
||||
return TimeSpan.Zero;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user