diff launch_gnb.sh @ 10:a0358a5ab3ae draft

planemo upload for repository https://github.com/galaxy-genome-annotation/galaxy-tools/tree/master/tools/genenotebook commit 0bc8333885dc11b283291458fb9d4bbd2052f6e0
author gga
date Mon, 24 Jun 2024 10:28:36 +0000
parents 29eeddd8ea62
children 4398a6fea625
line wrap: on
line diff
--- a/launch_gnb.sh	Mon Apr 08 09:41:33 2024 +0000
+++ b/launch_gnb.sh	Mon Jun 24 10:28:36 2024 +0000
@@ -60,7 +60,22 @@
 done;
 
 # Make sure that gnb is working, and that it's serving on the expected port
-curl "http://127.0.0.1:${GNB_PORT}/healthcheck" > /dev/null
+# Wait a bit for curl to work, just in case. Dump the logs if it does not
+
+tries_curl=0
+
+while ! curl -s "http://127.0.0.1:${GNB_PORT}/healthcheck"; do
+  tries_curl=$((tries_curl + 1))
+  if [ "$tries_curl" -ge 100 ]; then
+    echo "Healthcheck is not working, stopping:" 1>&2;
+    cat ./gnb.log 1>&2;
+    kill $GNB_PID $(<"./mongo.pid");
+    exit 1;
+  fi
+
+  sleep 3
+done;
+
 grep -q "Healthcheck OK" ./gnb.log
 
 echo "GNB is ready"