diff --git a/docker/init_scripts/init b/docker/init_scripts/init index 94fbf3b18..88444ee4d 100755 --- a/docker/init_scripts/init +++ b/docker/init_scripts/init @@ -72,7 +72,9 @@ run_startup() { wait_for_gunicorn_socket() { debug_log "Waiting for gunicorn socket file..." - local retries=60 + local wait_seconds=${WEB_SERVER_GUNICORN_WAIT_SECONDS:=30} + local retries=$((wait_seconds * 2)) + while [[ ! -S /tmp/gunicorn.sock && retries -gt 0 ]]; do sleep 0.5 ((retries--)) @@ -81,7 +83,7 @@ wait_for_gunicorn_socket() { if [[ -S /tmp/gunicorn.sock ]]; then debug_log "Gunicorn socket file found" else - warn_log "Gunicorn socket file not found after waiting 30s!" + warn_log "Gunicorn socket file not found after waiting ${wait_seconds}s!" fi } diff --git a/env.template b/env.template index 88f4f79ed..01edc57a7 100644 --- a/env.template +++ b/env.template @@ -122,6 +122,7 @@ WEB_SERVER_KEEPALIVE=2 WEB_SERVER_MAX_REQUESTS=1000 WEB_SERVER_MAX_REQUESTS_JITTER=100 WEB_SERVER_WORKER_CONNECTIONS=1000 +WEB_SERVER_GUNICORN_WAIT_SECONDS=30 IPV4_ONLY=false # Redis Workers