Consider adding an abstract HealthCheck base class that provides caching #535
sleberknight
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
CachingHealthCheck
(introduced in version 3.7.0, see #492 ) decorates aHealthCheck
to provide caching. In many cases this works great, for example health checks that are defined directly in a service. But if a health check is provided by a third-party library which provides its own initialization code, including health check registration, you may not have control over the health check in order to applyCachingHealthCheck
. In such situations, it would be nice if the library could (easily) support caching in its health check(s) and expose those as configuration options to users.Concretely, I have recently found several cases where I wanted to provide a health check (e.g., in a separate library) that can support caching as an optional feature. You can't use
CachingHealthCheck
in this manner.One way to support this functionality would be to create a base class that provides caching functionality, but allows the user to control whether it caches or not. For example, we could have a
AbstractCachingHealthCheck
that custom health check classes extend. Here is some pseudo-code:Beta Was this translation helpful? Give feedback.
All reactions