Merge pull request #3258 from overleaf/jpa-config-mongo-server-selection-timeout

[misc] add a config option for the mongo serverSelectionTimeoutMS

GitOrigin-RevId: 89b79e4fd5043b003da4ef103ddc919909aa7893
This commit is contained in:
Jakob Ackermann 2020-10-05 11:53:20 +02:00 committed by Copybot
parent 0c6e12a5cb
commit db422ecafa

View file

@ -44,6 +44,7 @@ module.exports = settings =
options: {
useUnifiedTopology: (process.env['MONGO_USE_UNIFIED_TOPOLOGY'] || 'true') == 'true',
poolSize: parseInt(process.env['MONGO_POOL_SIZE'], 10) || 10,
serverSelectionTimeoutMS: parseInt(process.env['MONGO_SERVER_SELECTION_TIMEOUT'], 10) || 60000,
socketTimeoutMS: parseInt(process.env['MONGO_SOCKET_TIMEOUT'], 10) || 30000,
},
url : process.env['MONGO_CONNECTION_STRING'] || process.env['MONGO_URL'] || "mongodb://#{process.env['MONGO_HOST'] or '127.0.0.1'}/sharelatex"