distribution/health
Cory Snider f2cbfe2402 health: improve periodic polling of checks
The API for periodic health checks is repetitive, with a distinct
function for polling a checker to each kind of updater. It also gives
the user no control over the lifetime of the polling goroutines nor
which context is passed into the checker.

Replace the existing PeriodicXYZChecker functions with a single Poll
function which composes an Updater with a Checker. Its context parameter
is passed into the checker and also controls when the polling loop
terminates. To guard against health checks failing closed (ostensibly
healthy) when the polling loop is terminated, the updater is forcefully
updated to an error status, overriding any configured threshold.

Signed-off-by: Cory Snider <csnider@mirantis.com>
2023-11-27 15:38:35 -05:00
..
api health: plumb contexts into health checks 2023-11-27 15:38:34 -05:00
checks health: plumb contexts into health checks 2023-11-27 15:38:34 -05:00
doc.go format code with gofumpt 2022-11-03 22:48:20 +01:00
health.go health: improve periodic polling of checks 2023-11-27 15:38:35 -05:00
health_test.go health: improve periodic polling of checks 2023-11-27 15:38:35 -05:00