using System; using Microsoft.Extensions.DependencyInjection; using Polly; using Volo.Abp.Http.Client; using Volo.Abp.Http.Client.IdentityModel; using Volo.Abp.Modularity; namespace Win_in.Sfs.Scp.WebApi.HttpApi.Client.ConsoleTestApp { [DependsOn( typeof(WebApiHttpApiClientModule), typeof(AbpHttpClientIdentityModelModule), typeof(WebApiApplicationContractsModule) )] public class WebApiConsoleApiClientModule : AbpModule { public override void PreConfigureServices(ServiceConfigurationContext context) { PreConfigure(options => { options.ProxyClientBuildActions.Add((remoteServiceName, clientBuilder) => { clientBuilder.AddTransientHttpErrorPolicy( policyBuilder => policyBuilder.WaitAndRetryAsync(3, i => TimeSpan.FromSeconds(Math.Pow(2, i))) ); }); }); } } }