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

Use pg_isready in make upgrade instead of sleep #3951

Merged
merged 1 commit into from
Oct 24, 2024
Merged

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
3 checks passed
@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