AspNetCore.Diagnostics.HealthChecks
AspNetCore.Diagnostics.HealthChecks copied to clipboard
AspNetCore.HealthChecks.Uris: AddUrlGroup has timeout parameter but it's not used for the given url.
The method AddUrlGroup has a parameter named timeout, but that is a global timeout for testing all Urls and not the specific Url you're adding.
Suggestion is to rename tiemout to globalTimeout or something more obvious and add a new timeout that you use when creating the items in the function.
Something like this would be good:
var options = new UriHealthCheckOptions()
.AddUri(uri)
.UseTimeout(timeout)
.UseHttpMethod(httpMethod);
Quick workaround is to use the AddUrlGroup that has the uriOptions parameter instead of url. And do like this:
uriOptions: uriOptions =>
{
uriOptions.AddUri(uri);
uriOptions.UseTimeout(TimeSpan.FromSeconds(120));
},