()
| 173 | } |
| 174 | |
| 175 | reset(): void { |
| 176 | const topologyVersion = this.server.description.topologyVersion; |
| 177 | if (isInCloseState(this) || topologyVersion == null) { |
| 178 | return; |
| 179 | } |
| 180 | |
| 181 | stateTransition(this, STATE_CLOSING); |
| 182 | resetMonitorState(this); |
| 183 | |
| 184 | // restart monitor |
| 185 | stateTransition(this, STATE_IDLE); |
| 186 | |
| 187 | // restart monitoring |
| 188 | const heartbeatFrequencyMS = this.options.heartbeatFrequencyMS; |
| 189 | const minHeartbeatFrequencyMS = this.options.minHeartbeatFrequencyMS; |
| 190 | this.monitorId = new MonitorInterval(monitorServer(this), { |
| 191 | heartbeatFrequencyMS: heartbeatFrequencyMS, |
| 192 | minHeartbeatFrequencyMS: minHeartbeatFrequencyMS |
| 193 | }); |
| 194 | } |
| 195 | |
| 196 | close(): void { |
| 197 | if (isInCloseState(this)) { |
no test coverage detected