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

Improve context based healthchecks #508

Merged

Conversation

HerrDerb
Copy link
Contributor

No description provided.

Copy link
Member

@xstefank xstefank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a few small changes needed.

private <T> HealthRegistry register(String id, T check, Map<String, T> checks) {
var alreadRegisteredCheck = checks.putIfAbsent(id, check);
if (Objects.nonNull(alreadRegisteredCheck)) {
throw new IllegalStateException(String.format("Check for ID '%s' already registerds", id));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
throw new IllegalStateException(String.format("Check for ID '%s' already registerds", id));
throw new IllegalStateException(String.format("Check for ID '%s' already registered", id));

Also, this would be a change in behavior. Do you need this for your use case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No this change actually has nothing to do with my usecase. I'll revert that.

import io.smallrye.health.api.Wellness;

@ApplicationScoped
public class ContextHealthCheckRegistrar {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class is not used by the test.

@xstefank
Copy link
Member

xstefank commented Jan 2, 2024

@HerrDerb, if you could also squash the commits, it would be great. Thanks!

@HerrDerb HerrDerb force-pushed the improve-context-based-healthchecks branch from 76ec26e to d2d7e16 Compare January 2, 2024 17:43
@HerrDerb HerrDerb requested a review from xstefank January 3, 2024 07:48
@xstefank xstefank merged commit 692995b into smallrye:main Jan 3, 2024
6 checks passed
@xstefank
Copy link
Member

xstefank commented Jan 3, 2024

Thanks @HerrDerb

@xstefank xstefank added this to the 4.1.0 milestone Jan 4, 2024
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

Successfully merging this pull request may close these issues.

2 participants