Browse Source

[Watchdog] Retry to get current ACME log status, if empty (may fix watchdog mails on very busy servers - eg while running a backup)

andryyy 5 years ago
parent
commit
9e11ab1fd4
2 changed files with 6 additions and 2 deletions
  1. 5 1
      data/Dockerfiles/watchdog/watchdog.sh
  2. 1 1
      docker-compose.yml

+ 5 - 1
data/Dockerfiles/watchdog/watchdog.sh

@@ -476,7 +476,11 @@ acme_checks() {
   while [ ${err_count} -lt ${THRESHOLD} ]; do
     err_c_cur=${err_count}
     ACME_LOG_STATUS_PREV=${ACME_LOG_STATUS}
-    ACME_LOG_STATUS=$(redis-cli -h redis GET ACME_FAIL_TIME)
+    ACME_LC=0
+    until [[ ! -z ${ACME_LOG_STATUS} ]] || [ ${ACME_LC} -ge 3 ]; do
+      ACME_LOG_STATUS=$(redis-cli -h redis GET ACME_FAIL_TIME 2> /dev/null)
+      ACME_LC=$((ACME_LC+1))
+    done
     if [[ ${ACME_LOG_STATUS_PREV} != ${ACME_LOG_STATUS} ]]; then
       err_count=$(( ${err_count} + 1 ))
     fi

+ 1 - 1
docker-compose.yml

@@ -365,7 +365,7 @@ services:
         - /lib/modules:/lib/modules:ro
 
     watchdog-mailcow:
-      image: mailcow/watchdog:1.65
+      image: mailcow/watchdog:1.66
       # Debug
       #command: /watchdog.sh
       dns: