Skip to content

Commit b8a9d85

Browse files
changes MaintenanceHealthCheck fail to Unhealty (#427)
1 parent 8350dec commit b8a9d85

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

PxWeb.UnitTests/Helpers/HealthCheckTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public void When_NoMaintenanceFile_Then_HealthCheckIsHealthy()
3333

3434

3535
[TestMethod]
36-
public void When_MaintenanceFile_Then_HealthCheckIsDegraded()
36+
public void When_MaintenanceFile_Then_HealthCheckIsUnhealthy()
3737
{
3838
var host = new Mock<IPxHost>();
3939
var tempPath = Path.GetTempPath();
@@ -54,7 +54,7 @@ public void When_MaintenanceFile_Then_HealthCheckIsDegraded()
5454
var cancellationToken = CancellationToken.None;
5555
var result = healthCheck.CheckHealthAsync(context, cancellationToken).Result;
5656
// Assert
57-
Assert.AreEqual(HealthStatus.Degraded, result.Status);
57+
Assert.AreEqual(HealthStatus.Unhealthy, result.Status);
5858

5959
File.Delete(maintenanceFilePath);
6060
}

PxWeb/Code/MaintenanceHealthCheck.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context, Canc
2222
{
2323
if (File.Exists(_maintenanceFilePath))
2424
{
25-
return Task.FromResult(HealthCheckResult.Degraded("Maintenance mode is active (.maintenance file found)."));
25+
return Task.FromResult(HealthCheckResult.Unhealthy("Maintenance mode is active (.maintenance file found)."));
2626
}
2727

2828
return Task.FromResult(HealthCheckResult.Healthy("No maintenance file found."));

0 commit comments

Comments
 (0)