Make the Postgres startup wait timeout configurable - #383
Make the Postgres startup wait timeout configurable#383NumericalAdvantage wants to merge 2 commits into
Conversation
The web, worker and receiver containers waited a hard-coded 60 seconds for
Postgres to accept connections, which is not always enough on a slow or loaded
host and could only be changed by editing committed compose files.
Replace the hard-coded value with ${WAIT_POSTGRES_TIMEOUT:-180} for the eight
Postgres waits in the dev and prod compose files and document the variable in
example.env. The unrelated orthanc1 and init.local waits are left as is.
📝 WalkthroughWalkthroughDevelopment and production Compose services now use the configurable ChangesPostgreSQL startup timeout configuration
Estimated code review effort: 1 (Trivial) | ~5 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
example.env (1)
103-105: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winInclude the production
initservice in the description.
docker-compose.prod.ymlLine 26 also usesWAIT_POSTGRES_TIMEOUTfor theinitservice. Update this comment so operators know that the setting controls production initialization as well.Proposed documentation update
-# Seconds the web and worker containers wait for Postgres to accept connections +# Seconds the web, init, and worker containers wait for Postgres to accept connections🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@example.env` around lines 103 - 105, Update the comment above WAIT_POSTGRES_TIMEOUT to state that the timeout applies to the web, worker, and production init containers while they wait for Postgres connections before startup or initialization proceeds.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@example.env`:
- Around line 103-105: Update the comment above WAIT_POSTGRES_TIMEOUT to state
that the timeout applies to the web, worker, and production init containers
while they wait for Postgres connections before startup or initialization
proceeds.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 39da5980-e0a5-4c87-8c4d-ddbc02402046
📒 Files selected for processing (3)
docker-compose.dev.ymldocker-compose.prod.ymlexample.env
Replaces #323, which was opened in April and had drifted behind
main. Same change, redone cleanly against currentmain— and it now covers the eight Postgres waits present today (the April branch only knew about six; more worker services have been added since).Companion to openradx/adit-radis-shared#225.
The web, worker and receiver containers wait a hard-coded 60 seconds for Postgres to accept connections. On a slow or loaded host that is not always enough, and the only way to change it was to edit committed compose files.
wait-for-it -t 60becomeswait-for-it -t ${WAIT_POSTGRES_TIMEOUT:-180}for the Postgres waits in the dev and prod compose files, and the variable is documented inexample.env. The unrelatedorthanc1andinit.localwaits are deliberately left alone.Verified with
docker compose config:-t 180WAIT_POSTGRES_TIMEOUT=300-t 300orthanc1/init.local-t 60/-t 300(unchanged)Summary by CodeRabbit