|
|
|
@ -1,11 +1,9 @@ |
|
|
|
using System; |
|
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
|
using Volo.Abp.Castle; |
|
|
|
using Volo.Abp.Modularity; |
|
|
|
using Volo.Abp.MultiTenancy; |
|
|
|
using Volo.Abp.Threading; |
|
|
|
using Volo.Abp.Validation; |
|
|
|
using Polly; |
|
|
|
using Volo.Abp.ExceptionHandling; |
|
|
|
|
|
|
|
namespace Volo.Abp.Http.Client |
|
|
|
@ -20,22 +18,6 @@ namespace Volo.Abp.Http.Client |
|
|
|
)] |
|
|
|
public class AbpHttpClientModule : AbpModule |
|
|
|
{ |
|
|
|
public override void PreConfigureServices(ServiceConfigurationContext context) |
|
|
|
{ |
|
|
|
PreConfigure<AbpHttpClientBuilderOptions>(options => |
|
|
|
{ |
|
|
|
options.ProxyClientBuildActions.Add((remoteServiceName, clientBuilder) => |
|
|
|
{ |
|
|
|
clientBuilder.AddTransientHttpErrorPolicy(policyBuilder => |
|
|
|
policyBuilder.WaitAndRetryAsync( |
|
|
|
3, |
|
|
|
i => TimeSpan.FromSeconds(Math.Pow(2, i)) |
|
|
|
) |
|
|
|
); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
public override void ConfigureServices(ServiceConfigurationContext context) |
|
|
|
{ |
|
|
|
var configuration = context.Services.GetConfiguration(); |
|
|
|
|