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

Method destroyConnection

src/cmap/connection_pool.ts:560–570  ·  view source on GitHub ↗
(
    connection: Connection,
    reason: 'error' | 'idle' | 'stale' | 'poolClosed'
  )

Source from the content-addressed store, hash-verified

558 }
559
560 private destroyConnection(
561 connection: Connection,
562 reason: 'error' | 'idle' | 'stale' | 'poolClosed'
563 ) {
564 this.emitAndLog(
565 ConnectionPool.CONNECTION_CLOSED,
566 new ConnectionClosedEvent(this, connection, reason)
567 );
568 // destroy the connection
569 connection.destroy();
570 }
571
572 private connectionIsStale(connection: Connection) {
573 const serviceId = connection.serviceId;

Callers 2

checkInMethod · 0.95

Calls 2

emitAndLogMethod · 0.80
destroyMethod · 0.45

Tested by

no test coverage detected