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

Method connectionIsStale

src/cmap/connection_pool.ts:572–581  ·  view source on GitHub ↗
(connection: Connection)

Source from the content-addressed store, hash-verified

570 }
571
572 private connectionIsStale(connection: Connection) {
573 const serviceId = connection.serviceId;
574 if (this.loadBalanced && serviceId) {
575 const sid = serviceId.toHexString();
576 const generation = this.serviceGenerations.get(sid);
577 return connection.generation !== generation;
578 }
579
580 return connection.generation !== this.generation;
581 }
582
583 private connectionIsIdle(connection: Connection) {
584 return !!(this.options.maxIdleTimeMS && connection.idleTime > this.options.maxIdleTimeMS);

Callers 2

checkInMethod · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected