From 41c20761e1608a3e6ad93e3b4dc64e7bc5fceb49 Mon Sep 17 00:00:00 2001 From: Opliko <25460763+oplik0@users.noreply.github.com> Date: Sat, 22 Feb 2020 02:15:07 +0100 Subject: [PATCH] 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/ --- src/database/mongo/connection.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/database/mongo/connection.js b/src/database/mongo/connection.js index cd380bddef..1001c58c03 100644 --- a/src/database/mongo/connection.js +++ b/src/database/mongo/connection.js @@ -45,9 +45,6 @@ connection.getConnectionOptions = function (mongo) { mongo = mongo || nconf.get('mongo'); var connOptions = { poolSize: 10, - reconnectTries: 3600, - reconnectInterval: 1000, - autoReconnect: true, connectTimeoutMS: 90000, useNewUrlParser: true, useUnifiedTopology: true,