@@ -645,23 +645,23 @@ export class MongoClient extends TypedEventEmitter<MongoClientEvents> implements
645645 *
646646 * This includes:
647647 *
648- * - Closes all open, unused connections (see note).
648+ * - Closes in-use connections.
649+ * - Closes all active cursors.
649650 * - Ends all in-use sessions with {@link ClientSession#endSession|ClientSession.endSession()}.
651+ * - aborts in progress transactions if is one related to the session.
650652 * - Ends all unused sessions server-side.
653+ * - Closes all remaining idle connections.
651654 * - Cleans up any resources being used for auto encryption if auto encryption is enabled.
652655 *
653- * @remarks Any in-progress operations are not killed and any connections used by in progress operations
654- * will be cleaned up lazily as operations finish.
655- *
656- * @param force - Force close, emitting no events
656+ * @param _force - currently an unused flag that has no effect. Defaults to `false`.
657657 */
658- async close ( force = false ) : Promise < void > {
658+ async close ( _force = false ) : Promise < void > {
659659 if ( this . closeLock ) {
660660 return await this . closeLock ;
661661 }
662662
663663 try {
664- this . closeLock = this . _close ( force ) ;
664+ this . closeLock = this . _close ( ) ;
665665 await this . closeLock ;
666666 } finally {
667667 // release
@@ -670,7 +670,7 @@ export class MongoClient extends TypedEventEmitter<MongoClientEvents> implements
670670 }
671671
672672 /* @internal */
673- private async _close ( force = false ) : Promise < void > {
673+ private async _close ( ) : Promise < void > {
674674 // There's no way to set hasBeenClosed back to false
675675 Object . defineProperty ( this . s , 'hasBeenClosed' , {
676676 value : true ,
@@ -726,7 +726,7 @@ export class MongoClient extends TypedEventEmitter<MongoClientEvents> implements
726726
727727 const { encrypter } = this . options ;
728728 if ( encrypter ) {
729- await encrypter . close ( this , force ) ;
729+ await encrypter . close ( this ) ;
730730 }
731731 }
732732
0 commit comments