Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@scottsauber
Last active May 22, 2017 03:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottsauber/0c0fcfa2d92c9c0693149ae282ff35c2 to your computer and use it in GitHub Desktop.
Save scottsauber/0c0fcfa2d92c9c0693149ae282ff35c2 to your computer and use it in GitHub Desktop.
public void ConfigureServices(IServiceCollection services)
{
services.AddHealthChecks(checks =>
{
// First parameter is the URL you want to check
// The second parameter is the CacheDuration of how long you want to hold onto the HealthCheckResult
// The default is 5 minutes, and in my case, I don't really want any cache at all
// because I don't want to wait up to 5 minutes if my service goes down to be notified about it
checks.AddUrlCheck("https://github.com", TimeSpan.FromMilliseconds(1));
});
services.AddMvc();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment