Skip to content

Commit

Permalink
Change sleep to timeout to avoid errors on slow computers and speed u…
Browse files Browse the repository at this point in the history
…p startup on fast computers
  • Loading branch information
davidguv committed Feb 4, 2021
1 parent 51aa3d7 commit bfd70cd
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions extras/docker/initDockerLicode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ check_result() {
run_rabbitmq() {
echo "Starting Rabbitmq"
rabbitmq-server -detached
sleep 5
timeout 15 bash -c 'until printf "" 2>>/dev/null >>/dev/tcp/$0/$1; do sleep 1; done' localhost 5672
}

run_mongo() {
Expand All @@ -75,7 +75,7 @@ run_mongo() {
fi
mongod --repair --dbpath $DB_DIR
mongod --nojournal --dbpath $DB_DIR --logpath $BUILD_DIR/mongo.log --fork
sleep 5
timeout 15 bash -c 'until printf "" 2>>/dev/null >>/dev/tcp/$0/$1; do sleep 1; done' localhost 27017
else
echo [licode] mongodb already running
fi
Expand Down Expand Up @@ -112,7 +112,13 @@ run_nuve() {
echo "Starting Nuve"
cd $ROOT/nuve/nuveAPI
node nuve.js &
sleep 5

nuvePort=`grep "config.nuve.port" $SCRIPTS/licode_default.js`

nuvePort=`echo $nuvePort| cut -d';' -f 1`
nuvePort=`echo $nuvePort| cut -d'=' -f 2`

timeout 15 bash -c 'until printf "" 2>>/dev/null >>/dev/tcp/$0/$1; do sleep 1; done' localhost $nuvePort
}
run_erizoController() {

Expand Down

0 comments on commit bfd70cd

Please sign in to comment.