Changed order in pipeline so SetHandlerLifetime() is first, right on the on the IHttpClientBuilder that is returned when creating the Typed Client.

This commit is contained in:
Cesar De la Torre Llorente 2018-05-21 20:06:39 -07:00
parent 1fa6242c1c
commit 6127457e8e

View File

@ -187,8 +187,8 @@ namespace Microsoft.eShopOnContainers.WebMVC
//add http client services
services.AddHttpClient<IBasketService, BasketService>()
.AddHttpMessageHandler<HttpClientAuthorizationDelegatingHandler>()
.SetHandlerLifetime(TimeSpan.FromMinutes(5)) //Sample. Default lifetime is 2 minutes
.AddHttpMessageHandler<HttpClientAuthorizationDelegatingHandler>()
.AddPolicyHandler(retriesWithExponentialBackoff)
.AddPolicyHandler(circuitBreaker);