Skip to content

Commit

Permalink
add timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsymbal Oleg committed Dec 4, 2018
1 parent 7725fff commit cca29d9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
3 changes: 2 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ if (!appPort) {
let url = `mongodb://${mongoHost}:${mongoPort}`;
let db;


// DATABASE: connect
let maxAttempts = 20;
for (let attempt = 0; attempt < maxAttempts; attempt++) {
Expand Down Expand Up @@ -104,7 +105,7 @@ for (let attempt = 0; attempt < maxAttempts; attempt++) {
}
}

setTimeout(attemptConnection, attempt * 2 * 1000);
setTimeout(attemptConnection, attempt * 2 * 60000);
}
// Prometheus //
/**
Expand Down
24 changes: 12 additions & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ services:
- MONGO_PORT=27017
- MONGO_DB_NAME=mydb
- APP_PORT=3000
depends_on:
- mongodb
# depends_on:
# - mongodb

mongodb:
image: mongo:3.2.20-jessie
container_name: "signnow-mongodb"
environment:
- MONGO_DATA_DIR=/data/db
volumes:
- db-data:/data/db
# local access for debug
ports:
- 27017:27017
# mongodb:
# image: mongo:3.2.20-jessie
# container_name: "signnow-mongodb"
# environment:
# - MONGO_DATA_DIR=/data/db
# volumes:
# - db-data:/data/db
# # local access for debug
# ports:
# - 27017:27017

volumes:
db-data:

0 comments on commit cca29d9

Please sign in to comment.