Skip to content

Implement retries on initial database connection #258

Open
@kenellorando

Description

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.

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions