Skip to content

Use pg_isready in make upgrade instead of sleep#3951

Merged
stchris merged 1 commit intodevelopfrom
chore/wait-for-pg
Oct 24, 2024
Merged

Use pg_isready in make upgrade instead of sleep#3951
stchris merged 1 commit intodevelopfrom
chore/wait-for-pg

Conversation

@stchris
Copy link
Contributor

@stchris stchris commented Oct 23, 2024

Small improvement, but I need this! No more sleep! 😳

Copy link
Contributor

@tillprochaska tillprochaska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, that’s great! :)

@stchris stchris merged commit c41c736 into develop Oct 24, 2024
@stchris stchris deleted the chore/wait-for-pg branch October 24, 2024 11:34
@arp242
Copy link
Contributor

arp242 commented Oct 25, 2024

What I did in Alfred is this in the compose.yaml file:

  elasticsearch:
    [...]
    healthcheck:
      test:     "exit $( ( curl -s 'http://localhost:9200/_cat/indices' || echo red ) | grep '^red' | wc -l )"
      interval: '5s'
      retries:  10

And then docker compose up --wait.

Maybe that /_cat/health?h=st is better for this though. But the advantage of putting it in the compose means it works everywhere, rather than just for your upgrade make target.

Just FYI, in case it's useful.

I didn't bother with PostgreSQL or other services as they're pretty quick to start, but ES is (very) slow.

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.

3 participants