Skip to content

Commit 7ae6dc3

Browse files
committed
fix: always decrement operation count
1 parent 7400c87 commit 7ae6dc3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sdam/server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,8 @@ export class Server extends TypedEventEmitter<ServerEvents> {
322322
try {
323323
conn = await this.pool.checkOut();
324324
} catch (checkoutError) {
325-
if (!(checkoutError instanceof PoolClearedError)) this.handleError(checkoutError);
326325
this.decrementOperationCount();
326+
if (!(checkoutError instanceof PoolClearedError)) this.handleError(checkoutError);
327327
throw checkoutError;
328328
}
329329
}
@@ -346,9 +346,9 @@ export class Server extends TypedEventEmitter<ServerEvents> {
346346
throw operationError;
347347
}
348348
} finally {
349+
this.decrementOperationCount();
349350
if (!connShouldBePinned) {
350351
this.pool.checkIn(conn);
351-
this.decrementOperationCount();
352352
}
353353
}
354354
}

0 commit comments

Comments
 (0)