Skip to content

Commit 6127457

Browse files
Changed order in pipeline so SetHandlerLifetime() is first, right on the on the IHttpClientBuilder that is returned when creating the Typed Client.
1 parent 1fa6242 commit 6127457

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Web/WebMVC/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ public static IServiceCollection AddHttpClientServices(this IServiceCollection s
187187

188188
//add http client services
189189
services.AddHttpClient<IBasketService, BasketService>()
190-
.AddHttpMessageHandler<HttpClientAuthorizationDelegatingHandler>()
191190
.SetHandlerLifetime(TimeSpan.FromMinutes(5)) //Sample. Default lifetime is 2 minutes
191+
.AddHttpMessageHandler<HttpClientAuthorizationDelegatingHandler>()
192192
.AddPolicyHandler(retriesWithExponentialBackoff)
193193
.AddPolicyHandler(circuitBreaker);
194194

0 commit comments

Comments
 (0)