Watchdog error handling

pull/3/head
Dominik Dzienia 2 years ago
parent 261d23c50c
commit 2c60195d4f

@ -1029,8 +1029,8 @@ admin_panel_promo() {
}
get_watchdog_age_string() {
local curr_time=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
local last_time=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
local curr_time=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
if [[ -f $WATCHDOG_TIME_FILE ]]; then
last_time=$(cat $WATCHDOG_TIME_FILE)
@ -1088,6 +1088,9 @@ get_watchdog_status_code_live() {
if [ "$COMBINED_STATUS" = "running running" ]; then
local domain=$(get_td_domain)
local domainLen=${#domain}
if ((domainLen > 15)); then
local html=$(curl -Lks "$domain")
if [[ "$html" =~ github.com/nightscout/cgm-remote-monitor ]]; then
@ -1103,6 +1106,10 @@ get_watchdog_status_code_live() {
status="restarting"
fi
else
status="detection_failed"
fi
else
if [ "$NS_STATUS" = "restarting" ] || [ "$DB_STATUS" = "restarting" ]; then
status="restarting"
@ -1571,6 +1578,9 @@ watchdog_check() {
if [ "$COMBINED_STATUS" = "running running" ]; then
echo "Will check page contents"
local domain=$(get_td_domain)
local domainLen=${#domain}
if ((domainLen > 15)); then
local html=$(curl -Lks "$domain")
WATCHDOG_STATUS="detection_failed"
@ -1595,6 +1605,10 @@ watchdog_check() {
WATCHDOG_STATUS="restarting"
fi
else
WATCHDOG_STATUS="detection_failed"
fi
else
if [ "$NS_STATUS" = "restarting" ] || [ "$DB_STATUS" = "restarting" ]; then
WATCHDOG_STATUS="restarting"

@ -1013,8 +1013,8 @@ admin_panel_promo() {
}
get_watchdog_age_string() {
local curr_time=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
local last_time=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
local curr_time=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
if [[ -f $WATCHDOG_TIME_FILE ]]; then
last_time=$(cat $WATCHDOG_TIME_FILE)
@ -1072,6 +1072,9 @@ get_watchdog_status_code_live() {
if [ "$COMBINED_STATUS" = "running running" ]; then
local domain=$(get_td_domain)
local domainLen=${#domain}
if ((domainLen > 15)); then
local html=$(curl -Lks "$domain")
if [[ "$html" =~ github.com/nightscout/cgm-remote-monitor ]]; then
@ -1087,6 +1090,10 @@ get_watchdog_status_code_live() {
status="restarting"
fi
else
status="detection_failed"
fi
else
if [ "$NS_STATUS" = "restarting" ] || [ "$DB_STATUS" = "restarting" ]; then
status="restarting"
@ -1555,6 +1562,9 @@ watchdog_check() {
if [ "$COMBINED_STATUS" = "running running" ]; then
echo "Will check page contents"
local domain=$(get_td_domain)
local domainLen=${#domain}
if ((domainLen > 15)); then
local html=$(curl -Lks "$domain")
WATCHDOG_STATUS="detection_failed"
@ -1579,6 +1589,10 @@ watchdog_check() {
WATCHDOG_STATUS="restarting"
fi
else
WATCHDOG_STATUS="detection_failed"
fi
else
if [ "$NS_STATUS" = "restarting" ] || [ "$DB_STATUS" = "restarting" ]; then
WATCHDOG_STATUS="restarting"

@ -1 +1 @@
2024-01-07T13:33:40.615Z
2024-01-07T14:13:41.909Z
Loading…
Cancel
Save