Skip to content

Commit 23956da

Browse files
committed
get options from this.clientOptions (always defined)
1 parent 87431a1 commit 23956da

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/sessions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ export class ClientSession
497497
readPreference: ReadPreference.primary,
498498
bypassPinningCheck: true
499499
});
500-
operation.maxAttempts = (this.client.topology?.s.options.maxAdaptiveRetries ?? 2) + 1;
500+
operation.maxAttempts = this.clientOptions.maxAdaptiveRetries + 1;
501501

502502
const timeoutContext =
503503
this.timeoutContext ??
@@ -517,7 +517,7 @@ export class ClientSession
517517
this.commitAttempted = true;
518518

519519
const remainingAttempts =
520-
(this.client.topology?.s.options.maxAdaptiveRetries ?? 2) + 1 - operation.attemptsMade;
520+
this.clientOptions.maxAdaptiveRetries + 1 - operation.attemptsMade;
521521
if (remainingAttempts <= 0) {
522522
throw firstCommitError;
523523
}

0 commit comments

Comments
 (0)