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

Method detectSrvRecords

src/sdam/topology.ts:360–381  ·  view source on GitHub ↗
(ev: SrvPollingEvent)

Source from the content-addressed store, hash-verified

358 }
359
360 private detectSrvRecords(ev: SrvPollingEvent) {
361 const previousTopologyDescription = this.s.description;
362 this.s.description = this.s.description.updateFromSrvPollingEvent(
363 ev,
364 this.s.options.srvMaxHosts
365 );
366 if (this.s.description === previousTopologyDescription) {
367 // Nothing changed, so return
368 return;
369 }
370
371 updateServers(this);
372
373 this.emitAndLog(
374 Topology.TOPOLOGY_DESCRIPTION_CHANGED,
375 new TopologyDescriptionChangedEvent(
376 this.s.id,
377 previousTopologyDescription,
378 this.s.description
379 )
380 );
381 }
382
383 /**
384 * @returns A `TopologyDescription` for this topology

Callers 1

constructorMethod · 0.95

Calls 3

updateServersFunction · 0.85
emitAndLogMethod · 0.80

Tested by

no test coverage detected