properly handle signals while sleeping

https://i.imgur.com/OpOvSut.png
This commit is contained in:
70m6
2022-06-15 17:04:00 +02:00
committed by GitHub
parent 3fb69019f1
commit 44da6aa643
+4 -2
View File
@@ -90,7 +90,8 @@ if [ "$1" = "autoheal" ] && [ -e "$DOCKER_SOCK" ];then
if [ "$AUTOHEAL_START_PERIOD" -gt 0 ]
then
echo "Monitoring containers for unhealthy status in $AUTOHEAL_START_PERIOD second(s)"
sleep "$AUTOHEAL_START_PERIOD"
sleep "$AUTOHEAL_START_PERIOD" &
wait $!
fi
while true
@@ -121,7 +122,8 @@ if [ "$1" = "autoheal" ] && [ -e "$DOCKER_SOCK" ];then
fi
fi
done
sleep "$AUTOHEAL_INTERVAL"
sleep "$AUTOHEAL_INTERVAL" &
wait $!
done
else