We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c7415ff commit f5bf252Copy full SHA for f5bf252
src/Middleware/HealthChecks.EntityFrameworkCore/src/DbContextHealthCheck.cs
@@ -1,6 +1,7 @@
1
// Licensed to the .NET Foundation under one or more agreements.
2
// The .NET Foundation licenses this file to you under the MIT license.
3
4
+using System.Data.Common;
5
using Microsoft.EntityFrameworkCore;
6
using Microsoft.Extensions.Options;
7
@@ -41,7 +42,7 @@ public async Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context
41
42
43
return new HealthCheckResult(context.Registration.FailureStatus);
44
}
- catch (Exception exception)
45
+ catch (Exception exception) when (exception is not OperationCanceledException || !cancellationToken.IsCancellationRequested)
46
{
47
return HealthCheckResult.Unhealthy(exception.Message, exception);
48
0 commit comments