From b30208fc6b14cf361376a512f0b4d01981afc473 Mon Sep 17 00:00:00 2001
From: Fabian Schindler <fabian.schindler.strauss@gmail.com>
Date: Sun, 29 Mar 2020 13:56:55 +0200
Subject: [PATCH] Adding optional timeout parameter to service waiting

---
 cache/entrypoint.sh        | 3 ++-
 core/Dockerfile            | 2 +-
 core/entrypoint.sh         | 3 ++-
 preprocessor/entrypoint.sh | 3 ++-
 4 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/cache/entrypoint.sh b/cache/entrypoint.sh
index 24f6491f..81a77cdf 100644
--- a/cache/entrypoint.sh
+++ b/cache/entrypoint.sh
@@ -1,10 +1,11 @@
 #!/bin/bash -e
 
 SERVICES=${WAIT_SERVICES:=''}
+TIMEOUT=${WAIT_TIMEOUT:='15'}
 
 if [[ ! -z $SERVICES ]] ; then
     for service in $SERVICES ; do
-        wait-for-it $service
+        wait-for-it -t $TIMEOUT $service
     done
 fi
 
diff --git a/core/Dockerfile b/core/Dockerfile
index 040b3f56..c6228df2 100644
--- a/core/Dockerfile
+++ b/core/Dockerfile
@@ -42,7 +42,6 @@ RUN apt update && \
   apt clean && \
   rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
 
-
 RUN pip3 install . && \
     pip3 install python-keystoneclient python-swiftclient redis
 
@@ -76,6 +75,7 @@ ADD rgbnir_definition.json \
     run-httpd.sh \
     run-registrar.sh \
     registrar.py \
+    mapcache_items_view.sql \
     entrypoint.sh \
     /
 
diff --git a/core/entrypoint.sh b/core/entrypoint.sh
index 5e6c9e95..e78b1330 100644
--- a/core/entrypoint.sh
+++ b/core/entrypoint.sh
@@ -1,10 +1,11 @@
 #!/bin/bash -e
 
 SERVICES=${WAIT_SERVICES:=''}
+TIMEOUT=${WAIT_TIMEOUT:='15'}
 
 if [[ ! -z $SERVICES ]] ; then
     for service in $SERVICES ; do
-        wait-for-it $service
+        wait-for-it -t $TIMEOUT $service
     done
 fi
 
diff --git a/preprocessor/entrypoint.sh b/preprocessor/entrypoint.sh
index 24f6491f..81a77cdf 100644
--- a/preprocessor/entrypoint.sh
+++ b/preprocessor/entrypoint.sh
@@ -1,10 +1,11 @@
 #!/bin/bash -e
 
 SERVICES=${WAIT_SERVICES:=''}
+TIMEOUT=${WAIT_TIMEOUT:='15'}
 
 if [[ ! -z $SERVICES ]] ; then
     for service in $SERVICES ; do
-        wait-for-it $service
+        wait-for-it -t $TIMEOUT $service
     done
 fi
 
-- 
GitLab