Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AspNetCore.HealthChecks.Uris: AddUrlGroup has timeout parameter but it's not used for the given url. #2377

Open
hartmark opened this issue Feb 28, 2025 · 1 comment

Comments

@hartmark
Copy link

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);

@hartmark
Copy link
Author

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));
                },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant