Skip to content

Commit 6cf3b32

Browse files
committed
fix: install-im-server
Signed-off-by: Xinwei Xiong (cubxxw) <[email protected]>
1 parent 49f4e3f commit 6cf3b32

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

scripts/install-im-server.sh

+13-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,19 @@ pushd "${OPENIM_ROOT}"
4545
${DOCKER_COMPOSE_COMMAND} stop
4646
curl https://gitee.com/openimsdk/openim-docker/raw/main/example/full-openim-server-and-chat.yml -o docker-compose.yml
4747
${DOCKER_COMPOSE_COMMAND} up -d
48-
sleep 60
48+
49+
# Wait for a short period to allow containers to initialize
50+
sleep 10
51+
52+
# Check the status of the containers
53+
if ! ${DOCKER_COMPOSE_COMMAND} ps | grep -q 'Up'; then
54+
echo "Error: One or more docker containers failed to start."
55+
${DOCKER_COMPOSE_COMMAND} logs
56+
exit 1
57+
fi
58+
59+
sleep 50 # Keep the original 60-second wait, adjusted for the 10-second check above
4960
${DOCKER_COMPOSE_COMMAND} logs openim-server
5061
${DOCKER_COMPOSE_COMMAND} ps
5162

52-
popd
63+
popd

0 commit comments

Comments
 (0)