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; }