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

Commit

Permalink
fix(server): avoid waiting for reconnect if reconnect disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 authored and mbroadst committed Oct 12, 2017
1 parent 9c7e212 commit 611a352
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/topologies/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,12 @@ function configureWireProtocolHandler(self, ismaster) {
function disconnectHandler(self, type, ns, cmd, options, callback) {
// Topology is not connected, save the call in the provided store to be
// Executed at some point when the handler deems it's reconnected
if (!self.s.pool.isConnected() && self.s.disconnectHandler != null && !options.monitoring) {
if (
!self.s.pool.isConnected() &&
self.s.options.reconnect &&
self.s.disconnectHandler != null &&
options.monitoring
) {
self.s.disconnectHandler.add(type, ns, cmd, options, callback);
return true;
}
Expand Down

0 comments on commit 611a352

Please sign in to comment.