Skip to content

Commit aae0cde

Browse files
committed
Address copilot review
1 parent efafd99 commit aae0cde

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/WebJobs.Script/Diagnostics/HealthChecks/WebJobsStorageHealthCheck.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ await client
107107

108108
return HealthCheckResult.Healthy();
109109
}
110-
catch (Exception ex)
110+
catch (Exception ex) when (!ex.IsFatal())
111111
{
112112
HealthCheckData data = GetData(ex, "connectivity");
113113
return HealthCheckResult.Unhealthy($"Unable to access {ConfigSection}", ex, data);
@@ -127,7 +127,7 @@ private async Task RunInBackgroundAsync()
127127
while (!cancellation.IsCancellationRequested)
128128
{
129129
TimeSpan delay = _context?.Registration?.Period ?? DefaultPeriod;
130-
await Task.Delay(delay);
130+
await Task.Delay(delay, cancellation);
131131
_last = await CheckHealthCoreAsync(cancellation).ConfigureAwait(false);
132132
}
133133
})
@@ -163,7 +163,7 @@ private bool TryGetClient(out BlobServiceClient client, out HealthCheckResult re
163163
result = HealthCheckResult.Healthy();
164164
return true;
165165
}
166-
catch (Exception ex)
166+
catch (Exception ex) when (!ex.IsFatal())
167167
{
168168
client = null;
169169
HealthCheckData data = GetData(ex, "configuration");

test/WebJobs.Script.Tests/Diagnostics/HealthChecks/HealthCheckExtensionsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public void AddScriptHostHealthCheck_RegistersScriptHostHealthCheck()
122122
}
123123

124124
[Fact]
125-
public void AdWebJobsStorageHealthCheck_RegistersWebJobsStorageHealthCheck()
125+
public void AddWebJobsStorageHealthCheck_RegistersWebJobsStorageHealthCheck()
126126
{
127127
// arrange
128128
Mock<IHealthChecksBuilder> builder = new(MockBehavior.Strict);

0 commit comments

Comments
 (0)