(connection: Connection)
| 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); |
no test coverage detected