File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -408,7 +408,8 @@ export class ConnectionPool extends TypedEventEmitter<ConnectionPoolEvents> {
408408 * Pool reset is handled by incrementing the pool's generation count. Any existing connection of a
409409 * previous generation will eventually be pruned during subsequent checkouts.
410410 */
411- clear ( serviceId ?: ObjectId ) : void {
411+ clear ( options : { serviceId ?: ObjectId } = { } ) : void {
412+ const { serviceId } = options ;
412413 if ( this . closed ) {
413414 return ;
414415 }
Original file line number Diff line number Diff line change @@ -400,14 +400,14 @@ export class Server extends TypedEventEmitter<ServerEvents> {
400400 error . addErrorLabel ( MongoErrorLabel . ResetPool ) ;
401401 markServerUnknown ( this , error ) ;
402402 } else if ( connection ) {
403- this . s . pool . clear ( connection . serviceId ) ;
403+ this . s . pool . clear ( { serviceId : connection . serviceId } ) ;
404404 }
405405 } else {
406406 if ( isSDAMUnrecoverableError ( error ) ) {
407407 if ( shouldHandleStateChangeError ( this , error ) ) {
408408 const shouldClearPool = maxWireVersion ( this ) <= 7 || isNodeShuttingDownError ( error ) ;
409409 if ( this . loadBalanced && connection && shouldClearPool ) {
410- this . s . pool . clear ( connection . serviceId ) ;
410+ this . s . pool . clear ( { serviceId : connection . serviceId } ) ;
411411 }
412412
413413 if ( ! this . loadBalanced ) {
Original file line number Diff line number Diff line change @@ -537,7 +537,7 @@ export function maybeClearPinnedConnection(
537537 ) ;
538538
539539 if ( options ?. forceClear ) {
540- loadBalancer . s . pool . clear ( conn . serviceId ) ;
540+ loadBalancer . s . pool . clear ( { serviceId : conn . serviceId } ) ;
541541 }
542542 }
543543
You can’t perform that action at this time.
0 commit comments