2025-05-27 14:02:24 +08:00
|
|
|
namespace JiShe.ServicePro.HttpApi.Client.ConsoleTestApp
|
2025-03-11 10:24:11 +08:00
|
|
|
{
|
|
|
|
|
[DependsOn(
|
2025-05-27 14:02:24 +08:00
|
|
|
typeof(ServiceProHttpApiClientModule),
|
2025-03-11 10:24:11 +08:00
|
|
|
typeof(AbpHttpClientIdentityModelModule)
|
|
|
|
|
)]
|
2025-05-27 14:02:24 +08:00
|
|
|
public class ServiceProConsoleApiClientModule : AbpModule
|
2025-03-11 10:24:11 +08:00
|
|
|
{
|
|
|
|
|
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)))
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|