Skip to content

Commit

Permalink
hc no-fail
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyclenerd committed Oct 18, 2022
1 parent 7e3ac46 commit 524b076
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions check_replication_status_hc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,14 @@ if [[ $MY_REPLICA_IO_RUNNING != 1 || $MY_REPLICA_SQL_RUNNING != 1 || $MY_SECONDS
echo "Replica_SQL_Running : $MY_REPLICA_SQL_RUNNING"
echo "Seconds_Behind_Source : $MY_SECONDS_BEHIND_SOURCE"
} >&2
curl -fsS -m 10 --retry 5 -o "/dev/null" "https://hc-ping.com/$MY_HC_ID/fail"
exit 9
if [ "$1" = "no-fail" ]; then
# do not ping healthchecks.io
exit 8
else
# send fail to healthchecks.io
curl -fsS -m 10 --retry 5 -o "/dev/null" "https://hc-ping.com/$MY_HC_ID/fail"
exit 9
fi
else
# echo OK to stdout
echo "OK"
Expand Down

0 comments on commit 524b076

Please sign in to comment.