Skip to content

Commit

Permalink
Amend
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobjmarks committed May 9, 2024
1 parent 0240eda commit daf7948
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Server.Functions/CheckHealth.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ public async Task<HttpResponseData> CheckHealthAsync(
[HttpTrigger(AuthorizationLevel.Function, "get", Route = "health")] HttpRequestData req)
{
var healthReport = await _healthCheckService.CheckHealthAsync();
return req.CreateResponse(healthReport.Status == HealthStatus.Healthy
? HttpStatusCode.OK
: HttpStatusCode.ServiceUnavailable);
return req.CreateResponse(healthReport.Status switch
{
HealthStatus.Unhealthy => HttpStatusCode.ServiceUnavailable,
_ => HttpStatusCode.OK,
});
}
}

0 comments on commit daf7948

Please sign in to comment.