From 5bf4edcac8ed7e61692ecfd50a816f4c2695e7d6 Mon Sep 17 00:00:00 2001 From: Dominik Deutsch Date: Wed, 12 May 2021 22:31:42 +0200 Subject: [PATCH] Run notify_webhook as background process instead of just the curl command --- docker-entrypoint | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-entrypoint b/docker-entrypoint index 386282f..eb482bf 100755 --- a/docker-entrypoint +++ b/docker-entrypoint @@ -63,7 +63,7 @@ notify_webhook() { if [ -n "$WEBHOOK_URL" ] then # execute webhook requests as background process to prevent healer from blocking - curl -X POST -H "Content-type: application/json" -d "$(generate_webhook_payload $text)" $WEBHOOK_URL & + curl -X POST -H "Content-type: application/json" -d "$(generate_webhook_payload $text)" $WEBHOOK_URL fi } @@ -115,9 +115,9 @@ if [ "$1" = "autoheal" ] && [ -e "$DOCKER_SOCK" ];then if ! restart_container "$CONTAINER_ID" "$TIMEOUT" then echo "$DATE Restarting container $CONTAINER_SHORT_ID failed" >&2 - notify_webhook "Container ${CONTAINER_NAME:1} (${CONTAINER_SHORT_ID}) found to be unhealthy. Failed to restart the container!" + notify_webhook "Container ${CONTAINER_NAME:1} (${CONTAINER_SHORT_ID}) found to be unhealthy. Failed to restart the container!" & else - notify_webhook "Container ${CONTAINER_NAME:1} (${CONTAINER_SHORT_ID}) found to be unhealthy. Successfully restarted the container!" + notify_webhook "Container ${CONTAINER_NAME:1} (${CONTAINER_SHORT_ID}) found to be unhealthy. Successfully restarted the container!" & fi fi done