Browse Source

Remove unused tables

pull/632/head
Unai Zorrilla Castro 6 years ago
parent
commit
554b4e4a0c
2 changed files with 0 additions and 76 deletions
  1. +0
    -10
      src/Web/WebMVC/Infrastructure/IResilientHttpClientFactory.cs
  2. +0
    -66
      src/Web/WebMVC/Infrastructure/ResilientHttpClientFactory.cs

+ 0
- 10
src/Web/WebMVC/Infrastructure/IResilientHttpClientFactory.cs View File

@ -1,10 +0,0 @@
using Microsoft.eShopOnContainers.BuildingBlocks.Resilience.Http;
using System;
namespace Microsoft.eShopOnContainers.WebMVC.Infrastructure
{
//public interface IResilientHttpClientFactory
//{
// ResilientHttpClient CreateResilientHttpClient();
//}
}

+ 0
- 66
src/Web/WebMVC/Infrastructure/ResilientHttpClientFactory.cs View File

@ -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<ResilientHttpClient> _logger;
// private readonly int _retryCount;
// private readonly int _exceptionsAllowedBeforeBreaking;
// private readonly IHttpContextAccessor _httpContextAccessor;
// public ResilientHttpClientFactory(ILogger<ResilientHttpClient> 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<HttpRequestException>()
// .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<HttpRequestException>()
// .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");
// })
// };
//}
}

Loading…
Cancel
Save