30 lines
		
	
	
		
			959 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			959 B
		
	
	
	
		
			C#
		
	
	
	
	
	
using System;
 | 
						|
using Microsoft.Extensions.DependencyInjection;
 | 
						|
using Polly;
 | 
						|
using Volo.Abp.Autofac;
 | 
						|
using Volo.Abp.Http.Client;
 | 
						|
using Volo.Abp.Http.Client.IdentityModel;
 | 
						|
using Volo.Abp.Modularity;
 | 
						|
 | 
						|
namespace KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp;
 | 
						|
 | 
						|
[DependsOn(
 | 
						|
    typeof(AbpAutofacModule),
 | 
						|
    typeof(TenantManagementHttpApiClientModule),
 | 
						|
    typeof(AbpHttpClientIdentityModelModule)
 | 
						|
)]
 | 
						|
public class TenantManagementConsoleApiClientModule : 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)))
 | 
						|
                );
 | 
						|
            });
 | 
						|
        });
 | 
						|
    }
 | 
						|
} |