From 473f3101b5b841c798cafb751a66d4fe08acc208 Mon Sep 17 00:00:00 2001 From: Bailey Pearson Date: Wed, 31 May 2023 18:49:57 -0600 Subject: [PATCH] consolidate logic --- src/mongo_client.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/mongo_client.ts b/src/mongo_client.ts index 890cba90d9..78eb626b30 100644 --- a/src/mongo_client.ts +++ b/src/mongo_client.ts @@ -450,9 +450,7 @@ export class MongoClient extends TypedEventEmitter { return maybeCallback(async () => { try { - if (this.connectionLock) return await this.connectionLock; - - this.connectionLock = this._connect(); + this.connectionLock = this.connectionLock ?? this._connect(); await this.connectionLock; return this; } finally {