Skip to content

Commit 473f310

Browse files
consolidate logic
1 parent 5887f33 commit 473f310

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/mongo_client.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,9 +450,7 @@ export class MongoClient extends TypedEventEmitter<MongoClientEvents> {
450450

451451
return maybeCallback(async () => {
452452
try {
453-
if (this.connectionLock) return await this.connectionLock;
454-
455-
this.connectionLock = this._connect();
453+
this.connectionLock = this.connectionLock ?? this._connect();
456454
await this.connectionLock;
457455
return this;
458456
} finally {

0 commit comments

Comments
 (0)