Last active
May 22, 2017 03:21
-
-
Save scottsauber/0c0fcfa2d92c9c0693149ae282ff35c2 to your computer and use it in GitHub Desktop.
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
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