summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2022-05-18 14:43:48 -0300
committerSebastian <sebasjm@gmail.com>2022-05-18 14:44:55 -0300
commit145714b335be7896501afe21cb8c7419c1e9cb83 (patch)
treef431b90d8891c29cf8e9804babdc683be17f9c84 /packages
parentc67d0bff1daa35d380d1d71b94428a5026b56450 (diff)
downloadwallet-core-145714b335be7896501afe21cb8c7419c1e9cb83.tar.gz
wallet-core-145714b335be7896501afe21cb8c7419c1e9cb83.tar.bz2
wallet-core-145714b335be7896501afe21cb8c7419c1e9cb83.zip
fix: to skip the operation maxRetries need to be calculated first
Diffstat (limited to 'packages')
-rw-r--r--packages/taler-wallet-core/src/wallet.ts17
1 files changed, 9 insertions, 8 deletions
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) {