Rate limiter code formatting (#17)

pull/19/head
Rick Anderson 2022-08-21 14:33:47 -10:00 committed by GitHub
parent 266024f802
commit 9db0c7dd65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -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);