taler-typescript-core

Wallet core logic and WebUIs for various components
Log | Files | Refs | Submodules | README | LICENSE

commit 145714b335be7896501afe21cb8c7419c1e9cb83
parent c67d0bff1daa35d380d1d71b94428a5026b56450
Author: Sebastian <sebasjm@gmail.com>
Date:   Wed, 18 May 2022 14:43:48 -0300

fix: to skip the operation maxRetries need to be calculated first

Diffstat:
Mpackages/taler-wallet-core/src/wallet.ts | 17+++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)

diff --git 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) {