Remove deprecated mongo connection options, fixes #8079 (#8174)

fix #8079 
Unified Topology changes the concept of connecting and causes isConnected to always return true, making any reconnection options useless. Next major version of the driver will remove isConnected entirely.
So:
- reconnect tries
- reconnectInterval
- autoReconnect

Are deprecated and don't really do anything anymore (when unified topology is used at least) other than causing warnings at startup since the 3.4 version of the driver (the current version used by NodeBB is 3.5).

Reference: http://mongodb.github.io/node-mongodb-native/3.5/reference/unified-topology/
This commit is contained in:
Opliko
2020-02-22 02:15:07 +01:00
committed by GitHub
parent 3c9689a5ac
commit 41c20761e1

View File

@@ -45,9 +45,6 @@ connection.getConnectionOptions = function (mongo) {
mongo = mongo || nconf.get('mongo'); mongo = mongo || nconf.get('mongo');
var connOptions = { var connOptions = {
poolSize: 10, poolSize: 10,
reconnectTries: 3600,
reconnectInterval: 1000,
autoReconnect: true,
connectTimeoutMS: 90000, connectTimeoutMS: 90000,
useNewUrlParser: true, useNewUrlParser: true,
useUnifiedTopology: true, useUnifiedTopology: true,