Skip to content

Commit ec1e04c

Browse files
committed
fix(monitoring): incorrect states used to determine rescheduling
1 parent 3915e11 commit ec1e04c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/core/sdam/monitoring.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ const ServerDescription = require('./server_description').ServerDescription;
44
const calculateDurationInMs = require('../utils').calculateDurationInMs;
55

66
// pulled from `Server` implementation
7-
const STATE_DISCONNECTED = 'disconnected';
8-
const STATE_DISCONNECTING = 'disconnecting';
7+
const STATE_CLOSED = 'closed';
8+
const STATE_CLOSING = 'closing';
99

1010
/**
1111
* Published when server description changes, but does NOT include changes to the RTT.
@@ -180,7 +180,7 @@ function monitorServer(server, options) {
180180

181181
// emit an event indicating that our description has changed
182182
server.emit('descriptionReceived', new ServerDescription(server.description.address, isMaster));
183-
if (server.s.state === STATE_DISCONNECTED || server.s.state === STATE_DISCONNECTING) {
183+
if (server.s.state === STATE_CLOSED || server.s.state === STATE_CLOSING) {
184184
return;
185185
}
186186

0 commit comments

Comments
 (0)