We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 87431a1 commit 23956daCopy full SHA for 23956da
1 file changed
src/sessions.ts
@@ -497,7 +497,7 @@ export class ClientSession
497
readPreference: ReadPreference.primary,
498
bypassPinningCheck: true
499
});
500
- operation.maxAttempts = (this.client.topology?.s.options.maxAdaptiveRetries ?? 2) + 1;
+ operation.maxAttempts = this.clientOptions.maxAdaptiveRetries + 1;
501
502
const timeoutContext =
503
this.timeoutContext ??
@@ -517,7 +517,7 @@ export class ClientSession
517
this.commitAttempted = true;
518
519
const remainingAttempts =
520
- (this.client.topology?.s.options.maxAdaptiveRetries ?? 2) + 1 - operation.attemptsMade;
+ this.clientOptions.maxAdaptiveRetries + 1 - operation.attemptsMade;
521
if (remainingAttempts <= 0) {
522
throw firstCommitError;
523
}
0 commit comments