Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement retries on initial database connection #258

Open
kenellorando opened this issue Nov 1, 2023 · 0 comments
Open

Implement retries on initial database connection #258

kenellorando opened this issue Nov 1, 2023 · 0 comments
Labels
domain: cadence-api Relates to cadence API domain: cadence-db Relates to cadence database type: enhancement

Comments

@kenellorando
Copy link
Owner

The Cadence container starts up faster than the Postgres container it depends on when launched through a Docker Compose stack normally. Since Cadence does a bunch of database configuration on initial connect, we end up without a working database.

We alleviate this currently with a hardcoded wait time before initial connect.

// We wait a bit to give some leeway for Postgres to finish startup.
// Obligatory: There's probably a better way to do this.
time.Sleep(5 * time.Second)

A more precise method (maybe timed auto-retry through Compose or in code) would be better.

@kenellorando kenellorando added type: enhancement domain: cadence-api Relates to cadence API domain: cadence-db Relates to cadence database labels Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain: cadence-api Relates to cadence API domain: cadence-db Relates to cadence database type: enhancement
Projects
None yet
Development

No branches or pull requests

1 participant