lifecycle: fix worker healthcheck (#5259)

closes #5258

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens L 2023-04-14 14:39:31 +02:00 committed by GitHub
parent 38bf0ee740
commit 1a4c640835
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -81,7 +81,7 @@ elif [[ "$1" == "healthcheck" ]]; then
if [[ $mode == "server" ]]; then if [[ $mode == "server" ]]; then
exec curl --user-agent "goauthentik.io lifecycle Healthcheck" -I http://localhost:9000/-/health/ready/ exec curl --user-agent "goauthentik.io lifecycle Healthcheck" -I http://localhost:9000/-/health/ready/
elif [[ $mode == "worker" ]]; then elif [[ $mode == "worker" ]]; then
mtime=$(stat -f %m $WORKER_HEARTBEAT) mtime=$(date -r $WORKER_HEARTBEAT +"%s")
time=$(date +"%s") time=$(date +"%s")
if [ "$(( $time - $mtime ))" -gt "30" ]; then if [ "$(( $time - $mtime ))" -gt "30" ]; then
log "Worker hasn't updated heartbeat in 30 seconds" log "Worker hasn't updated heartbeat in 30 seconds"