fix: ensure proper exit code handling in scheduler entrypoint script

This commit is contained in:
Théophile Diot 2024-12-09 11:45:25 +01:00
parent f56524a35d
commit f397200535
No known key found for this signature in database
GPG key ID: FA995104A0BA376A

View file

@ -38,13 +38,13 @@ fi
log "ENTRYPOINT" " " "Executing scheduler ..."
/usr/share/bunkerweb/scheduler/main.py &
pid="$!"
wait "$pid"
while [ -f /var/run/bunkerweb/scheduler.pid ] ; do
wait "$pid"
done
exit_code=$?
if [ -f /var/tmp/bunkerweb/scheduler.healthy ] ; then
rm /var/tmp/bunkerweb/scheduler.healthy
rm -f /var/tmp/bunkerweb/scheduler.healthy
fi
log "ENTRYPOINT" " " "Scheduler stopped"
exit 0
exit $exit_code