File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
src/WebJobs.Script.WebHost/Diagnostics/HealthChecks Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ namespace Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.HealthChecks
11
11
{
12
12
public sealed class HealthCheckWaitMiddleware ( RequestDelegate next , IScriptHostManager manager )
13
13
{
14
+ private const int MaxWaitSeconds = 60 ;
14
15
private readonly RequestDelegate _next = next ?? throw new ArgumentNullException ( nameof ( next ) ) ;
15
16
private readonly IScriptHostManager _manager = manager ?? throw new ArgumentNullException ( nameof ( manager ) ) ;
16
17
@@ -31,7 +32,8 @@ await context.Response.WriteAsJsonAsync(
31
32
return ;
32
33
}
33
34
34
- await _manager . DelayUntilHostReadyAsync ( waitSeconds ) ;
35
+ waitSeconds = Math . Min ( waitSeconds , MaxWaitSeconds ) ;
36
+ await _manager . DelayUntilHostReadyAsync ( waitSeconds ) . WaitAsync ( context . RequestAborted ) ;
35
37
}
36
38
37
39
await _next ( context ) ;
You can’t perform that action at this time.
0 commit comments