From 145714b335be7896501afe21cb8c7419c1e9cb83 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Wed, 18 May 2022 14:43:48 -0300 Subject: fix: to skip the operation maxRetries need to be calculated first --- packages/taler-wallet-core/src/wallet.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'packages/taler-wallet-core/src') diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts index e2d504446..ffceec38f 100644 --- a/packages/taler-wallet-core/src/wallet.ts +++ b/packages/taler-wallet-core/src/wallet.ts @@ -337,14 +337,6 @@ async function runTaskLoop( let minDue: AbsoluteTime = AbsoluteTime.never(); for (const p of pending.pendingOperations) { - minDue = AbsoluteTime.min(minDue, p.timestampDue); - if (AbsoluteTime.isExpired(p.timestampDue)) { - numDue++; - } - if (p.givesLifeness) { - numGivingLiveness++; - } - const maxRetries = opts.maxRetries; if (maxRetries && p.retryInfo && p.retryInfo.retryCounter > maxRetries) { @@ -353,6 +345,15 @@ async function runTaskLoop( ); continue; } + + minDue = AbsoluteTime.min(minDue, p.timestampDue); + if (AbsoluteTime.isExpired(p.timestampDue)) { + numDue++; + } + if (p.givesLifeness) { + numGivingLiveness++; + } + } if (opts.stopWhenDone && numGivingLiveness === 0 && iteration !== 0) { -- cgit v1.2.3