Last active
April 25, 2019 19:35
-
-
Save AlonAm/1fd5b587b42e358570b99abeaadcf4a3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| using AnyStatus.API; | |
| using System.Threading.Tasks; | |
| public class MyWidgetHealthCheck : ICheckHealth<MyWidget> | |
| { | |
| public async Task Handle(HealthCheckRequest<MyWidget> request, CancellationToken cancellationToken) | |
| { | |
| var myWidget = request.DataContext; | |
| await Task.Delay(1).ConfigureAwait(false); | |
| if (true) | |
| { | |
| myWidget.State = State.Ok; | |
| } | |
| else | |
| { | |
| throw new Exception("My widget health check failed."); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment