reduce dlob publisher health check grace period, clean up logs

This commit is contained in:
wphan
2024-11-27 11:00:34 -08:00
parent cc4adfa061
commit fa8fd24fd4
5 changed files with 16 additions and 15 deletions

View File

@@ -181,9 +181,7 @@ export const setHealthStatus = (status: HEALTH_STATUS): void => {
* We may be hit by multiple sources performing health checks on us, so this middleware will latch
* to its health state and only update every `healthCheckInterval`.
*
* A grace period is also used to only report unhealthy if we have been unhealthy for a certain
* amount of time. This prevents reporting unhealthy even if we are just in the middle of a
* bulk account load.
* A grace period is also used to only report unhealthy if we have been unhealthy beyond the grace period.
*/
const handleHealthCheck = (
healthCheckGracePeriod: number,
@@ -191,6 +189,7 @@ const handleHealthCheck = (
) => {
return async (_req, res, _next) => {
if (healthStatus === HEALTH_STATUS.Restart) {
logger.error(`Health status: Restart`);
res.writeHead(500);
res.end(`NOK`);
return;