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'))"
|
log "Cycle $CYCLE — all healthy ($(date '+%H:%M:%S'))"
|
||||||
# Heartbeat — periodic proof of life
|
# Heartbeat — periodic proof of life
|
||||||
if [[ "${DOCKER_WATCHDOG_HEARTBEAT:-true}" == true ]]; then
|
if [[ "${DOCKER_WATCHDOG_HEARTBEAT:-true}" == true ]]; then
|
||||||
local hb_seconds=$(( ${DOCKER_WATCHDOG_HEARTBEAT_HOURS:-1} * 3600 ))
|
HB_SECONDS=$(( ${DOCKER_WATCHDOG_HEARTBEAT_HOURS:-1} * 3600 ))
|
||||||
local uptime_seconds=$(( CYCLE * DOCKER_WATCHDOG_INTERVAL ))
|
UPTIME_SECONDS=$(( CYCLE * DOCKER_WATCHDOG_INTERVAL ))
|
||||||
if (( uptime_seconds % hb_seconds < DOCKER_WATCHDOG_INTERVAL )); then
|
if [[ "$HB_SECONDS" -gt 0 ]] && (( UPTIME_SECONDS % HB_SECONDS < DOCKER_WATCHDOG_INTERVAL )) && [[ "$UPTIME_SECONDS" -gt 0 ]]; then
|
||||||
local uptime_hr=$(( uptime_seconds / 3600 ))
|
HB_UPTIME_HR=$(( UPTIME_SECONDS / 3600 ))
|
||||||
info "♥ docker_watchdog alive — ~${uptime_hr}hr uptime ($(date '+%H:%M:%S'))"
|
info "♥ docker_watchdog alive — ~${HB_UPTIME_HR}hr uptime ($(date '+%H:%M:%S'))"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -429,11 +429,11 @@ while [[ "$WATCHDOG_RUNNING" == true ]]; do
|
|||||||
log "Cycle $CYCLE — system healthy ($(date '+%H:%M:%S'))"
|
log "Cycle $CYCLE — system healthy ($(date '+%H:%M:%S'))"
|
||||||
# Heartbeat — periodic proof of life
|
# Heartbeat — periodic proof of life
|
||||||
if [[ "${SYSTEM_WATCHDOG_HEARTBEAT:-true}" == true ]]; then
|
if [[ "${SYSTEM_WATCHDOG_HEARTBEAT:-true}" == true ]]; then
|
||||||
local hb_seconds=$(( ${SYSTEM_WATCHDOG_HEARTBEAT_HOURS:-1} * 3600 ))
|
HB_SECONDS=$(( ${SYSTEM_WATCHDOG_HEARTBEAT_HOURS:-1} * 3600 ))
|
||||||
local uptime_seconds=$(( CYCLE * SYSTEM_WATCHDOG_INTERVAL ))
|
UPTIME_SECONDS=$(( CYCLE * SYSTEM_WATCHDOG_INTERVAL ))
|
||||||
if (( uptime_seconds % hb_seconds < SYSTEM_WATCHDOG_INTERVAL )); then
|
if [[ "$HB_SECONDS" -gt 0 ]] && (( UPTIME_SECONDS % HB_SECONDS < SYSTEM_WATCHDOG_INTERVAL )) && [[ "$UPTIME_SECONDS" -gt 0 ]]; then
|
||||||
local uptime_hr=$(( uptime_seconds / 3600 ))
|
HB_UPTIME_HR=$(( UPTIME_SECONDS / 3600 ))
|
||||||
info "♥ system_watchdog alive — ~${uptime_hr}hr uptime ($(date '+%H:%M:%S'))"
|
info "♥ system_watchdog alive — ~${HB_UPTIME_HR}hr uptime ($(date '+%H:%M:%S'))"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user