quick update to watchdogs
This commit is contained in:
@@ -567,11 +567,11 @@ while [[ "$WATCHDOG_RUNNING" == true ]]; do
|
||||
log "Cycle $CYCLE — all healthy ($(date '+%H:%M:%S'))"
|
||||
# Heartbeat — periodic proof of life
|
||||
if [[ "${DOCKER_WATCHDOG_HEARTBEAT:-true}" == true ]]; then
|
||||
local hb_seconds=$(( ${DOCKER_WATCHDOG_HEARTBEAT_HOURS:-1} * 3600 ))
|
||||
local uptime_seconds=$(( CYCLE * DOCKER_WATCHDOG_INTERVAL ))
|
||||
if (( uptime_seconds % hb_seconds < DOCKER_WATCHDOG_INTERVAL )); then
|
||||
local uptime_hr=$(( uptime_seconds / 3600 ))
|
||||
info "♥ docker_watchdog alive — ~${uptime_hr}hr uptime ($(date '+%H:%M:%S'))"
|
||||
HB_SECONDS=$(( ${DOCKER_WATCHDOG_HEARTBEAT_HOURS:-1} * 3600 ))
|
||||
UPTIME_SECONDS=$(( CYCLE * DOCKER_WATCHDOG_INTERVAL ))
|
||||
if [[ "$HB_SECONDS" -gt 0 ]] && (( UPTIME_SECONDS % HB_SECONDS < DOCKER_WATCHDOG_INTERVAL )) && [[ "$UPTIME_SECONDS" -gt 0 ]]; then
|
||||
HB_UPTIME_HR=$(( UPTIME_SECONDS / 3600 ))
|
||||
info "♥ docker_watchdog alive — ~${HB_UPTIME_HR}hr uptime ($(date '+%H:%M:%S'))"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user