Skip to content

Retry pre-deploy migrations against a waking database - #3

Merged
lobbystack merged 1 commit into
mainfrom
fix/migrate-retry
Sep 16, 2026
Merged

lobbystack merged 1 commit into
mainfrom
fix/migrate-retry

Conversation

@lobbystack

Copy link
Copy Markdown
Owner

Follow-up to #2. The previous fix retried the app schema probe, but the Railway preDeploy step (bun --no-install migrate.js) still connected once and crashed when Postgres was asleep, failing the deployment before the server started.

  • Wrap store.migrate() and the Better Auth migration transaction in the same bounded retry used by startup, so pre-deploy migrations wait for a waking database instead of failing the deploy.
  • Tighten the retry budget (30 attempts, 500ms base, 3s cap) so worst-case startup stays under the 120s healthcheck timeout.

Verified locally: server type check and tests pass.

@lobbystack
lobbystack merged commit 72797e8 into main Sep 16, 2026
0 of 12 checks passed
@lobbystack
lobbystack deleted the fix/migrate-retry branch September 16, 2026 17:32
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant