|
@@ -1,5 +1,7 @@
|
|
#!/bin/bash
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
+source /source_env.sh
|
|
|
|
+
|
|
# Do not attempt to write to slave
|
|
# Do not attempt to write to slave
|
|
if [[ ! -z ${REDIS_SLAVEOF_IP} ]]; then
|
|
if [[ ! -z ${REDIS_SLAVEOF_IP} ]]; then
|
|
REDIS_CMDLINE="redis-cli -h ${REDIS_SLAVEOF_IP} -p ${REDIS_SLAVEOF_PORT}"
|
|
REDIS_CMDLINE="redis-cli -h ${REDIS_SLAVEOF_IP} -p ${REDIS_SLAVEOF_PORT}"
|
|
@@ -18,7 +20,7 @@ FAILED_SYNCS=$(doveadm replicator status | grep "Waiting 'failed' requests" | gr
|
|
|
|
|
|
# Set amount of failed jobs as DOVECOT_REPL_HEALTH
|
|
# Set amount of failed jobs as DOVECOT_REPL_HEALTH
|
|
# 1 failed job for mailcow.local is expected and healthy
|
|
# 1 failed job for mailcow.local is expected and healthy
|
|
-if [[ "${FAILED_SYNCS}" != 1 ]]; then
|
|
|
|
|
|
+if [[ "${FAILED_SYNCS}" != 0 ]] && [[ "${FAILED_SYNCS}" != 1 ]]; then
|
|
printf "Dovecot replicator has %d failed jobs\n" "${FAILED_SYNCS}"
|
|
printf "Dovecot replicator has %d failed jobs\n" "${FAILED_SYNCS}"
|
|
${REDIS_CMDLINE} SET DOVECOT_REPL_HEALTH "${FAILED_SYNCS}" > /dev/null
|
|
${REDIS_CMDLINE} SET DOVECOT_REPL_HEALTH "${FAILED_SYNCS}" > /dev/null
|
|
else
|
|
else
|