Skip to content
This repository was archived by the owner on Feb 4, 2022. It is now read-only.

Commit 611a352

Browse files
vkarpov15mbroadst
authored andcommitted
fix(server): avoid waiting for reconnect if reconnect disabled
1 parent 9c7e212 commit 611a352

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/topologies/server.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,12 @@ function configureWireProtocolHandler(self, ismaster) {
266266
function disconnectHandler(self, type, ns, cmd, options, callback) {
267267
// Topology is not connected, save the call in the provided store to be
268268
// Executed at some point when the handler deems it's reconnected
269-
if (!self.s.pool.isConnected() && self.s.disconnectHandler != null && !options.monitoring) {
269+
if (
270+
!self.s.pool.isConnected() &&
271+
self.s.options.reconnect &&
272+
self.s.disconnectHandler != null &&
273+
options.monitoring
274+
) {
270275
self.s.disconnectHandler.add(type, ns, cmd, options, callback);
271276
return true;
272277
}

0 commit comments

Comments
 (0)