Skip to content

Commit 9180a9a

Browse files
committed
chore: fix endSession call
1 parent 21a2de9 commit 9180a9a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/sessions.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -533,11 +533,7 @@ export function maybeClearPinnedConnection(
533533
const servers = Array.from(topology.s.servers.values());
534534
const loadBalancer = servers[0];
535535

536-
if (
537-
options?.error == null ||
538-
options?.error?.name === 'MongoExpiredSessionError' ||
539-
options?.force
540-
) {
536+
if (options?.error == null || options?.force) {
541537
loadBalancer.pool.checkIn(conn);
542538
session[kPinnedConnection] = undefined;
543539
conn.emit(

0 commit comments

Comments
 (0)