You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Polly/RateLimit/LockFreeTokenBucketRateLimiter.cs
+1-5Lines changed: 1 addition & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -33,11 +33,6 @@ public LockFreeTokenBucketRateLimiter(TimeSpan onePer, long bucketCapacity)
33
33
thrownewArgumentOutOfRangeException(nameof(onePer),onePer,$"The {nameof(LockFreeTokenBucketRateLimiter)} must specify a positive TimeSpan for how often an execution is permitted.");
34
34
}
35
35
36
-
if(bucketCapacity<=0)
37
-
{
38
-
thrownewArgumentOutOfRangeException(nameof(bucketCapacity),bucketCapacity,$"{nameof(bucketCapacity)} must be greater than or equal to 1.");
39
-
}
40
-
41
36
_addTokenTickInterval=onePer.Ticks;
42
37
_bucketCapacity=bucketCapacity;
43
38
@@ -82,6 +77,7 @@ public LockFreeTokenBucketRateLimiter(TimeSpan onePer, long bucketCapacity)
// But if we were way overdue refilling the bucket (there was inactivity for a while), that value would be out-of-date: the next time we add tokens must be at least addTokenTickInterval from now.
Copy file name to clipboardExpand all lines: src/Polly/Registry/PolicyRegistry.cs
+7-2Lines changed: 7 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -25,8 +25,13 @@ public PolicyRegistry()
25
25
/// <remarks>This internal constructor exists solely to facilitate testing of the GetEnumerator() methods, which allow us to support collection initialisation syntax.</remarks>
26
26
/// </summary>
27
27
/// <param name="registry">a dictionary containing keys and policies used for testing.</param>
0 commit comments