diff --git a/src/Web/WebMVC/Infrastructure/IResilientHttpClientFactory.cs b/src/Web/WebMVC/Infrastructure/IResilientHttpClientFactory.cs deleted file mode 100644 index 39b36f141..000000000 --- a/src/Web/WebMVC/Infrastructure/IResilientHttpClientFactory.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Microsoft.eShopOnContainers.BuildingBlocks.Resilience.Http; -using System; - -namespace Microsoft.eShopOnContainers.WebMVC.Infrastructure -{ - //public interface IResilientHttpClientFactory - //{ - // ResilientHttpClient CreateResilientHttpClient(); - //} -} \ No newline at end of file diff --git a/src/Web/WebMVC/Infrastructure/ResilientHttpClientFactory.cs b/src/Web/WebMVC/Infrastructure/ResilientHttpClientFactory.cs deleted file mode 100644 index 09b596f1c..000000000 --- a/src/Web/WebMVC/Infrastructure/ResilientHttpClientFactory.cs +++ /dev/null @@ -1,66 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.eShopOnContainers.BuildingBlocks.Resilience.Http; -using Microsoft.Extensions.Logging; -using Polly; -using System; -using System.Net.Http; - -namespace Microsoft.eShopOnContainers.WebMVC.Infrastructure -{ - //public class ResilientHttpClientFactory : IResilientHttpClientFactory - //{ - // private readonly ILogger _logger; - // private readonly int _retryCount; - // private readonly int _exceptionsAllowedBeforeBreaking; - // private readonly IHttpContextAccessor _httpContextAccessor; - - // public ResilientHttpClientFactory(ILogger logger, IHttpContextAccessor httpContextAccessor, int exceptionsAllowedBeforeBreaking = 5, int retryCount = 6) - // { - // _logger = logger; - // _exceptionsAllowedBeforeBreaking = exceptionsAllowedBeforeBreaking; - // _retryCount = retryCount; - // _httpContextAccessor = httpContextAccessor; - // } - - - // public ResilientHttpClient CreateResilientHttpClient() - // => new ResilientHttpClient((origin) => CreatePolicies(), _logger, _httpContextAccessor); - - // private Policy[] CreatePolicies() - // => new Policy[] - // { - // Policy.Handle() - // .WaitAndRetryAsync( - // // number of retries - // _retryCount, - // // exponential backofff - // retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)), - // // on retry - // (exception, timeSpan, retryCount, context) => - // { - // var msg = $"Retry {retryCount} implemented with Polly's RetryPolicy " + - // $"of {context.PolicyKey} " + - // $"at {context.OperationKey}, " + - // $"due to: {exception}."; - // _logger.LogWarning(msg); - // _logger.LogDebug(msg); - // }), - // Policy.Handle() - // .CircuitBreakerAsync( - // // number of exceptions before breaking circuit - // _exceptionsAllowedBeforeBreaking, - // // time circuit opened before retry - // TimeSpan.FromMinutes(1), - // (exception, duration) => - // { - // // on circuit opened - // _logger.LogTrace("Circuit breaker opened"); - // }, - // () => - // { - // // on circuit closed - // _logger.LogTrace("Circuit breaker reset"); - // }) - // }; - //} -}