From 819b691249305cfbe8b1ff35d41cd1359431e085 Mon Sep 17 00:00:00 2001 From: Thomas E Lackey Date: Mon, 25 Mar 2024 11:50:40 -0500 Subject: [PATCH] Restart API if needed. --- run.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/run.sh b/run.sh index bf06a4c..3d3eabc 100755 --- a/run.sh +++ b/run.sh @@ -94,10 +94,7 @@ if [[ -n "$IMAGE_REGISTRY_CREDS" ]]; then docker login --password "$IMAGE_REGISTRY_CREDS" --username ${IMAGE_REGISTRY_USER:-ANY} $IMAGE_REGISTRY fi -echo "Starting API" cd /app/ -yarn start & - while true; do UPDATE_OPTS="" if [[ "true" == "${ONLY_NEW_REQUESTS:-true}" ]] && [[ ! -f "${DEPLOYMENTS_DIR}/autodeploy.state" ]]; then @@ -105,6 +102,12 @@ while true; do fi echo "==============================================================" + ps -ef | grep node | grep 'yarn start' >/dev/null + if [ $? -ne 0 ]; then + echo "########### STARTING API ############" + echo "Starting API" + yarn start & + fi echo "########### UNDEPLOY ############" laconic-so undeploy-webapp-from-registry \