fix: Minstrel waits for its database at startup instead of exiting
release / web (push) Successful in 1m12s
release / go (push) Failing after 1m12s
release / govulncheck (push) Successful in 16s
release / integration (push) Successful in 3m49s
release / android (push) Successful in 4m28s
release / Build signed APK (push) Successful in 5m54s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Skipped
release / Verify release artifacts (tag releases only) (push) Skipped

A first docker compose up starts Minstrel and a new Postgres together, and
the database spends several seconds initialising before it takes
connections. Minstrel tried once and exited, and with no restart policy
in the quick-start compose it stayed down. It now retries every two
seconds for up to two minutes, logging each attempt, and only then exits
with the last connection error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-25 09:46:19 -05:00
co-authored by Claude Opus 5.5
parent 34c0690667
commit 040b90898b
3 changed files with 133 additions and 0 deletions
+3
View File
@@ -142,6 +142,9 @@ func run() error {
ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
defer stop()
if err := db.WaitReady(ctx, cfg.Database.URL, logger); err != nil {
return fmt.Errorf("database: %w", err)
}
if err := db.Migrate(cfg.Database.URL, logger); err != nil {
return fmt.Errorf("migrate: %w", err)
}