Rate limiter code formatting (#17)
parent
266024f802
commit
9db0c7dd65
|
@ -129,11 +129,11 @@ app.Configuration.GetSection(MyRateLimitOptions.MyRateLimit).Bind(myOptions);
|
|||
app.UseRateLimiter(new RateLimiterOptions()
|
||||
.AddTokenBucketLimiter(policyName: tokenPolicy,
|
||||
new TokenBucketRateLimiterOptions(tokenLimit: myOptions.tokenLimit,
|
||||
queueProcessingOrder: QueueProcessingOrder.OldestFirst,
|
||||
queueLimit: myOptions.queueLimit,
|
||||
replenishmentPeriod: TimeSpan.FromSeconds(myOptions.replenishmentPeriod),
|
||||
tokensPerPeriod: myOptions.tokensPerPeriod,
|
||||
autoReplenishment: myOptions.autoReplenishment)));
|
||||
queueProcessingOrder: QueueProcessingOrder.OldestFirst,
|
||||
queueLimit: myOptions.queueLimit,
|
||||
replenishmentPeriod: TimeSpan.FromSeconds(myOptions.replenishmentPeriod),
|
||||
tokensPerPeriod: myOptions.tokensPerPeriod,
|
||||
autoReplenishment: myOptions.autoReplenishment)));
|
||||
|
||||
app.MapGet("/", () => Results.Ok($"Token Limiter {GetTicks()}"))
|
||||
.RequireRateLimiting(tokenPolicy);
|
||||
|
|
Loading…
Reference in New Issue