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

healthcheck.sh: Fail when API call fails; No curl progress #321

Merged
merged 1 commit into from
Sep 18, 2024

Conversation

ashfire908
Copy link
Contributor

Couple fixes to healthcheck.sh:

  • Adds set -o pipefail to make sure jq fails when the curl call fails.
    • I assume this would be the intended behavior, though I wonder about if server startup takes too long (ie steam is updating the client still) that this might cause issues... If preferred, I can pull this out and research a better way to handle the health checks here.
  • Silences curl progress, unless there's an error.
    • This quiets down the health check output, which currently looks like this on my system (note the curl output):
      Screenshot 2024-09-18 at 10 30 13 AM

@wolveix
Copy link
Owner

wolveix commented Sep 18, 2024

Thanks for the PR @ashfire908!

Regarding the set -o pipefail aspect, presumably the health of the container would just drop to unhealthy until the download etc. are sorted. Am I misunderstanding this?

@ashfire908
Copy link
Contributor Author

Yes, that is correct. I honestly didn't have a chance to do a full verification of it before (ie build a new image and run it, instead of just testing the changes piecemeal in the image with a simple shell), so I was unsure if docker/docker-compose would restart the container if the health check fails. I just checked, and it doesn't seem to do that. So I guess there are no issues in that context.

@wolveix wolveix merged commit 66695d0 into wolveix:main Sep 18, 2024
2 checks passed
@wolveix
Copy link
Owner

wolveix commented Sep 18, 2024

Great stuff, thanks so much @ashfire908!

@ashfire908 ashfire908 deleted the healthcheck-fixes branch September 18, 2024 21:05
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.

2 participants