Skip to content

Commit

Permalink
fix(monitoring): incorrect states used to determine rescheduling
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst committed Nov 5, 2019
1 parent 3915e11 commit ec1e04c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/core/sdam/monitoring.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit ec1e04c

Please sign in to comment.