forked from domingoladron/AspnetCoreHealthChecks
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding in secondary logic for a health check.
- Loading branch information
Chris
committed
Jun 29, 2019
1 parent
e78e992
commit bfdad66
Showing
3 changed files
with
27 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
HealthChecks.SomeModelService/Health/SecondaryHealthCheck.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Microsoft.Extensions.Diagnostics.HealthChecks; | ||
|
||
namespace HealthChecks.SomeModelService.Health | ||
{ | ||
public class SecondaryHealthCheck : IHealthCheck | ||
{ | ||
public Task<HealthCheckResult> CheckHealthAsync( | ||
HealthCheckContext context, | ||
CancellationToken cancellationToken = new CancellationToken()) | ||
{ | ||
return Task.FromResult(HealthCheckResult.Degraded("Not feeling so well, boss!")); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters