|
|
@ -49,15 +49,15 @@ public class AgentModule : AbpModule |
|
|
|
PreConfigure<AbpHttpClientBuilderOptions>(options => |
|
|
|
{ |
|
|
|
//Polly 重试3次
|
|
|
|
options.ProxyClientBuildActions.Add((remoteServiceName, clientBuilder) => |
|
|
|
{ |
|
|
|
clientBuilder.AddTransientHttpErrorPolicy(policyBuilder => |
|
|
|
policyBuilder.WaitAndRetryAsync( |
|
|
|
3, |
|
|
|
i => TimeSpan.FromSeconds(Math.Pow(2, i)) |
|
|
|
) |
|
|
|
); |
|
|
|
}); |
|
|
|
//options.ProxyClientBuildActions.Add((remoteServiceName, clientBuilder) =>
|
|
|
|
//{
|
|
|
|
// clientBuilder.AddTransientHttpErrorPolicy(policyBuilder =>
|
|
|
|
// policyBuilder.WaitAndRetryAsync(
|
|
|
|
// 3,
|
|
|
|
// i => TimeSpan.FromSeconds(Math.Pow(2, i))
|
|
|
|
// )
|
|
|
|
// );
|
|
|
|
//});
|
|
|
|
|
|
|
|
//默认添加Authorization Header: Bearer Token
|
|
|
|
options.ProxyClientActions.Add((a, s, h) => |
|
|
|