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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user