changes to the startup
This commit is contained in:
+4
-1
@@ -96,7 +96,10 @@ wait_for_mongo_ready() {
|
|||||||
while [ $elapsed -lt $timeout_seconds ]; do
|
while [ $elapsed -lt $timeout_seconds ]; do
|
||||||
container_state="$(${DOCKER_CMD[@]} inspect -f '{{.State.Status}} {{if .State.Health}}{{.State.Health.Status}}{{end}}' "$mongo_container_id" 2>/dev/null || true)"
|
container_state="$(${DOCKER_CMD[@]} inspect -f '{{.State.Status}} {{if .State.Health}}{{.State.Health.Status}}{{end}}' "$mongo_container_id" 2>/dev/null || true)"
|
||||||
health_status="${container_state#* }"
|
health_status="${container_state#* }"
|
||||||
if [ "${container_state%% *}" = "running" ]; then
|
if [ "$health_status" = "healthy" ]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
if [ "${container_state%% *}" = "running" ] && [ -z "$health_status" ]; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
if [ "${container_state%% *}" = "exited" ] || [ "${container_state%% *}" = "dead" ]; then
|
if [ "${container_state%% *}" = "exited" ] || [ "${container_state%% *}" = "dead" ]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user