-
Notifications
You must be signed in to change notification settings - Fork 37
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
Improve context based healthchecks #508
Conversation
There was a problem hiding this 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)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
@HerrDerb, if you could also squash the commits, it would be great. Thanks! |
76ec26e
to
d2d7e16
Compare
Thanks @HerrDerb |
No description provided.