Skip to content

Instantly share code, notes, and snippets.

@AlonAm
Last active May 11, 2018 18:27
Show Gist options
  • Save AlonAm/541ea7571b46f7404818f8c3a8eecf89 to your computer and use it in GitHub Desktop.
Save AlonAm/541ea7571b46f7404818f8c3a8eecf89 to your computer and use it in GitHub Desktop.
AnyStatus Handler
using AnyStatus.API;
using System.Threading.Tasks;
public class MyHealthChecker : ICheckHealth<MyHealthCheck>
{
public async Task Handle(HealthCheckRequest<MyHealthCheck> request, CancellationToken cancellationToken)
{
var myHealthCheck = request.DataContext;
await Task.Delay(1).ConfigureAwait(false);
if (true)
{
myHealthCheck.State = State.Ok;
}
else
{
throw new Exception("My health check failed.");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment