From 02a69e6994cbf391f3bb7acdb19f69eac9cbc775 Mon Sep 17 00:00:00 2001 From: pedro Date: Thu, 30 Jan 2025 08:59:01 +0100 Subject: [PATCH] devicehub: add error handling when waiting idhub --- docker/devicehub-django.entrypoint.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docker/devicehub-django.entrypoint.sh b/docker/devicehub-django.entrypoint.sh index 0035dca..d98ff11 100644 --- a/docker/devicehub-django.entrypoint.sh +++ b/docker/devicehub-django.entrypoint.sh @@ -120,8 +120,12 @@ END # wait until idhub api is prepared to received requests wait_idhub() { + echo "Start waiting idhub API" while true; do - result="$(curl -s "${url}" | jq -r .error)" + result="$(curl -s "${url}" \ + | jq -r .error \ + || echo "Reported errors, idhub API is still not ready")" + if [ "${result}" = "Invalid request method" ]; then break else