From cfe948c4d29170ba186b04bc1f7a8a0943d98031 Mon Sep 17 00:00:00 2001 From: alexbelgium Date: Tue, 11 Aug 2026 19:16:57 +0200 Subject: [PATCH] fix(komga): use a wall clock deadline for the readiness wait An attempt count plus a per probe timeout stretched the wait to roughly twice the advertised 15 minute ceiling. Co-Authored-By: Claude Opus 5 --- komga/rootfs/etc/services.d/nginx/run | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/komga/rootfs/etc/services.d/nginx/run b/komga/rootfs/etc/services.d/nginx/run index 777ef92b16..adc1f43f5f 100755 --- a/komga/rootfs/etc/services.d/nginx/run +++ b/komga/rootfs/etc/services.d/nginx/run @@ -10,8 +10,12 @@ set -e # would either fail instantly or block for the whole timeout. # The per probe timeouts keep the 15 minute ceiling real : without them a # half open connection would hang a single probe, and the loop, forever. +# A wall clock deadline, not an attempt count : a failed probe costs up to +# max-time on top of the sleep, so counting attempts would stretch the wait to +# roughly twice the advertised ceiling. komga_ready=false -for _ in $(seq 1 180); do +deadline=$((SECONDS + 900)) +while [ "$SECONDS" -lt "$deadline" ]; do if curl -sf --connect-timeout 2 --max-time 5 -o /dev/null "http://127.0.0.1:25600/komga/"; then komga_ready=true break