@@ -81,24 +81,24 @@ public static void Main()
8181
8282 var builder = WebApplication . CreateBuilder ( [ ] ) ;
8383
84- builder . Services . AddRateLimiter ( options =>
85- {
86- options . AddFixedWindowLimiter ( "max 2 per second" , config =>
87- {
88- config . PermitLimit = 2 ;
89- config . Window = TimeSpan . FromSeconds ( 1 ) ;
90- config . AutoReplenishment = true ;
91- } ) ;
92-
93- //var fixedWindowRateLimiterOptions = new FixedWindowRateLimiterOptions();
94- //var policyName = "max 2 per second (from AddPolicy)";
95- // options.AddPolicy(policyName, context =>
96- // {
97- // return fixedWindowRateLimiterOptions;
98- // });
99- } ) ;
84+ // builder.Services.AddRateLimiter(options =>
85+ // {
86+ // options.AddFixedWindowLimiter("max 2 per second", config =>
87+ // {
88+ // config.PermitLimit = 2;
89+ // config.Window = TimeSpan.FromSeconds(1);
90+ // config.AutoReplenishment = true;
91+ // });
92+ //
93+ // //var fixedWindowRateLimiterOptions = new FixedWindowRateLimiterOptions();
94+ // //var policyName = "max 2 per second (from AddPolicy)";
95+ // // options.AddPolicy(policyName, context =>
96+ // // {
97+ // // return fixedWindowRateLimiterOptions;
98+ // // });
99+ // });
100100
101- var fixedWindowRateLimiterOptions = new FixedWindowRateLimiterOptions ( ) ;
101+ // var fixedWindowRateLimiterOptions = new FixedWindowRateLimiterOptions();
102102
103103 builder
104104 . Services
@@ -210,7 +210,8 @@ public static void Main()
210210 UseDefaultUploadMetadataContextKey = true ,
211211 //DefaultUploadMetadataContextKey = "request.upload_metadata",
212212 } ,
213- RateLimiterOptions = new RateLimiterOptions { Enabled = true }
213+
214+ //RateLimiterOptions = new RateLimiterOptions { Enabled = true }
214215 } ) ;
215216 app . Run ( ) ;
216217 }
0 commit comments