Skip to content

Commit

Permalink
Slow down health checks to avoid high CPU usage
Browse files Browse the repository at this point in the history
see moby/moby#39102

users can still override the interval with a lower value when
running automated tests to achieve faster checks
  • Loading branch information
schnapster committed Dec 27, 2022
1 parent b353199 commit e3d0194
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ COPY run.sh /usr/local/bin/

ENTRYPOINT ["/bin/bash", "run.sh"]

HEALTHCHECK --interval=1s --retries=1 CMD LAST_DB=$(echo $DB | awk '{print $NF}'); /usr/bin/psql -U $POSTGRES_USER -tAc "SELECT 1 FROM pg_database WHERE datname='$LAST_DB';" | grep -q 1 || exit 1
HEALTHCHECK --interval=30s --retries=1 CMD LAST_DB=$(echo $DB | awk '{print $NF}'); /usr/bin/psql -U $POSTGRES_USER -tAc "SELECT 1 FROM pg_database WHERE datname='$LAST_DB';" | grep -q 1 || exit 1

0 comments on commit e3d0194

Please sign in to comment.