MCPcopy
hub / github.com/mongodb/node-mongodb-native / reset

Method reset

src/sdam/monitor.ts:175–194  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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)) {

Callers 4

markServerUnknownFunction · 0.45
ParserFunction · 0.45
livereload.jsFile · 0.45

Calls 3

isInCloseStateFunction · 0.85
resetMonitorStateFunction · 0.85
monitorServerFunction · 0.85

Tested by

no test coverage detected