From ec1e04cafc08e49993f7755593b979af99b79733 Mon Sep 17 00:00:00 2001 From: Matt Broadstone Date: Sun, 3 Nov 2019 08:56:03 -0500 Subject: [PATCH] fix(monitoring): incorrect states used to determine rescheduling --- lib/core/sdam/monitoring.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/core/sdam/monitoring.js b/lib/core/sdam/monitoring.js index 15f081c89d..98b46636ac 100644 --- a/lib/core/sdam/monitoring.js +++ b/lib/core/sdam/monitoring.js @@ -4,8 +4,8 @@ const ServerDescription = require('./server_description').ServerDescription; const calculateDurationInMs = require('../utils').calculateDurationInMs; // pulled from `Server` implementation -const STATE_DISCONNECTED = 'disconnected'; -const STATE_DISCONNECTING = 'disconnecting'; +const STATE_CLOSED = 'closed'; +const STATE_CLOSING = 'closing'; /** * Published when server description changes, but does NOT include changes to the RTT. @@ -180,7 +180,7 @@ function monitorServer(server, options) { // emit an event indicating that our description has changed server.emit('descriptionReceived', new ServerDescription(server.description.address, isMaster)); - if (server.s.state === STATE_DISCONNECTED || server.s.state === STATE_DISCONNECTING) { + if (server.s.state === STATE_CLOSED || server.s.state === STATE_CLOSING) { return; }