Browse Source
Merge pull request #117 from abpframework/liangshiwei/patch
Application remote service configuration error
pull/119/head
maliming
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
15 additions and
0 deletions
-
apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbp.PublicWeb.csproj
-
apps/public-web/src/EShopOnAbp.PublicWeb/EShopOnAbpPublicWebModule.cs
|
|
|
@ -6,6 +6,7 @@ |
|
|
|
|
|
|
|
<ItemGroup> |
|
|
|
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="6.0.1" /> |
|
|
|
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="6.0.7" /> |
|
|
|
<PackageReference Include="Volo.Abp.AutoMapper" Version="5.1.2" /> |
|
|
|
<PackageReference Include="Yarp.ReverseProxy" Version="1.0.0" /> |
|
|
|
</ItemGroup> |
|
|
|
|
|
|
|
@ -20,6 +20,7 @@ using StackExchange.Redis; |
|
|
|
using System; |
|
|
|
using System.Net.Http.Headers; |
|
|
|
using Microsoft.AspNetCore.HttpOverrides; |
|
|
|
using Polly; |
|
|
|
using Volo.Abp; |
|
|
|
using Volo.Abp.Account; |
|
|
|
using Volo.Abp.AspNetCore.Authentication.OpenIdConnect; |
|
|
|
@ -74,6 +75,19 @@ public class EShopOnAbpPublicWebModule : AbpModule |
|
|
|
typeof(EShopOnAbpPublicWebModule).Assembly |
|
|
|
); |
|
|
|
}); |
|
|
|
|
|
|
|
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) |
|
|
|
|