1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-08-22 22:02:59 +00:00

Added Reset functionality to rate limiter implementation, added reset of rate limit per connection when connection is disconnected

This commit is contained in:
Jkorf
2026-04-10 09:39:19 +02:00
parent 93d92beea6
commit 9add5e0adc
14 changed files with 416 additions and 231 deletions
@@ -29,6 +29,14 @@ namespace CryptoExchange.Net.RateLimiting.Trackers
_entries = new Queue<LimitEntry>();
}
/// <inheritdoc />
public void Reset()
{
_entries.Clear();
_currentWeight = 0;
_nextReset = null;
}
public TimeSpan GetWaitTime(int weight)
{
// Remove requests no longer in time period from the history