Skip to content

Commit 699a036

Browse files
committed
fix: apparently there is a timeout for circuit breaker too
1 parent 0289c94 commit 699a036

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Catglobe.CgScript.Deployment/HostExtensions.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@ private static IServiceCollection AddCommonCgScript(IServiceCollection services)
4747
})
4848
.AddHttpMessageHandler<DeploymentAuthHandler>()
4949
.AddStandardResilienceHandler(o => {
50-
o.AttemptTimeout.Timeout = TimeSpan.FromMinutes(10);
51-
o.TotalRequestTimeout.Timeout = TimeSpan.FromMinutes(20);
50+
o.AttemptTimeout.Timeout = TimeSpan.FromMinutes(10);
51+
o.CircuitBreaker.SamplingDuration = TimeSpan.FromMinutes(20);
52+
o.TotalRequestTimeout.Timeout = TimeSpan.FromMinutes(30);
5253
});
5354
services.AddHttpClient<DeploymentAuthenticator>((sp, httpClient) => {
5455
httpClient.BaseAddress = sp.GetRequiredService<IOptions<DeploymentOptions>>().Value.Authority;

Catglobe.CgScript.Runtime/HostExtensions.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ private static IServiceCollection AddCommonCgScript(IServiceCollection services,
5252
: services.AddHttpClient<ILongRunningCgScriptApiClient, CgScriptApiClient>(configureClient))
5353
.AddHttpMessageHandler<CgScriptAuthHandler>()
5454
.AddStandardResilienceHandler(o => {
55-
o.AttemptTimeout.Timeout = TimeSpan.FromMinutes(30);
56-
o.TotalRequestTimeout.Timeout = TimeSpan.FromMinutes(90);
55+
o.AttemptTimeout.Timeout = TimeSpan.FromMinutes(30);
56+
o.TotalRequestTimeout.Timeout = TimeSpan.FromMinutes(90);
57+
o.CircuitBreaker.SamplingDuration = TimeSpan.FromMinutes(60);
5758
});
5859
return services;
5960
}

0 commit comments

Comments
 (0)