mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-08-27 07:13:32 +02:00
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user