From 322841cbebafa754042639f712dd3210f863448a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 11 Dec 2025 12:43:03 +0000 Subject: [PATCH] Use localhost for consistency and fix timing to report 0 seconds when ready immediately Co-authored-by: DerLinkman <62480600+DerLinkman@users.noreply.github.com> --- data/Dockerfiles/clamd/clamd.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/Dockerfiles/clamd/clamd.sh b/data/Dockerfiles/clamd/clamd.sh index 0d838276b..c4ed3e683 100755 --- a/data/Dockerfiles/clamd/clamd.sh +++ b/data/Dockerfiles/clamd/clamd.sh @@ -103,7 +103,7 @@ echo "Waiting up to ${STARTUP_GRACE_PERIOD} seconds for clamd to start up..." # Helper function to check if clamd is ready clamd_is_ready() { - echo "PING" | nc -w 1 127.0.0.1 3310 2>/dev/null | grep -q "PONG" + [ "$(echo "PING" | nc -w 1 localhost 3310 2>/dev/null)" = "PONG" ] } # Wait for clamd to be ready or until timeout @@ -120,11 +120,11 @@ while [ ${ELAPSED} -lt ${STARTUP_GRACE_PERIOD} ]; do break fi - sleep ${POLL_INTERVAL} ELAPSED=$((ELAPSED + POLL_INTERVAL)) + sleep ${POLL_INTERVAL} done -# Report final status +# Report final status only if not already reported as ready if [ ${CLAMD_READY} -eq 0 ]; then if clamd_is_ready; then echo "clamd is now ready (started during final check)"