From d594d6f5171b4e54772803b3e4573d357f4ad34f Mon Sep 17 00:00:00 2001 From: Xinwei Xiong <3293172751@qq.com> Date: Tue, 2 Jan 2024 12:42:46 +0800 Subject: [PATCH] fix: install-im-server (#1648) Signed-off-by: Xinwei Xiong (cubxxw) <3293172751nss@gmail.com> --- scripts/install-im-server.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/scripts/install-im-server.sh b/scripts/install-im-server.sh index 47db34433..e52a1a21a 100755 --- a/scripts/install-im-server.sh +++ b/scripts/install-im-server.sh @@ -45,8 +45,19 @@ pushd "${OPENIM_ROOT}" ${DOCKER_COMPOSE_COMMAND} stop curl https://gitee.com/openimsdk/openim-docker/raw/main/example/full-openim-server-and-chat.yml -o docker-compose.yml ${DOCKER_COMPOSE_COMMAND} up -d -sleep 60 + +# Wait for a short period to allow containers to initialize +sleep 10 + +# Check the status of the containers +if ! ${DOCKER_COMPOSE_COMMAND} ps | grep -q 'Up'; then + echo "Error: One or more docker containers failed to start." + ${DOCKER_COMPOSE_COMMAND} logs + exit 1 +fi + +sleep 50 # Keep the original 60-second wait, adjusted for the 10-second check above ${DOCKER_COMPOSE_COMMAND} logs openim-server ${DOCKER_COMPOSE_COMMAND} ps -popd \ No newline at end of file +popd