Skip to content

Commit b508f8d

Browse files
update isRetry on each iteration of the transaction loop
1 parent b27507d commit b508f8d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/sessions.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,11 @@ export class ClientSession
739739
let lastError: Error | null = null;
740740

741741
try {
742-
retryTransaction: for (let attempt = 0, isRetry = attempt > 0; !committed; ++attempt) {
742+
retryTransaction: for (
743+
let attempt = 0, isRetry = false;
744+
!committed;
745+
++attempt, isRetry = attempt > 0
746+
) {
743747
if (isRetry) {
744748
const BACKOFF_INITIAL_MS = 5;
745749
const BACKOFF_MAX_MS = 500;

0 commit comments

Comments
 (0)