Esempio n. 1
0
        public AglCoreSvc(HttpClient httpClient, ILogger <AglCoreSvc> logger, IOptions <UrlsConfig> config, IAglIdentitySvc IdentityServer)
        {
            _httpClient     = httpClient;
            _logger         = logger;
            _urls           = config.Value;
            _IdentityServer = IdentityServer;

            //set polly retry policies for microservices
            _httpRetryPolicy =
                Policy.HandleResult <HttpResponseMessage>(msg => msg.StatusCode == System.Net.HttpStatusCode.GatewayTimeout)
                .Or <TimeoutRejectedException>()
                .WaitAndRetryAsync(2, retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt)));

            //set timeout policy
            _timeoutPolicy = Policy.TimeoutAsync(25);
        }
 public IdentityController(IAglIdentitySvc svc)
 {
     _svc = svc;
 }