summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/wallet.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-09-03 20:38:26 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-09-03 20:38:26 +0530
commitf51a59bc72c2886cb2bb88b149a3353857e3eb44 (patch)
treefee6f86112580241f8328869c1e71dd58e238fa9 /packages/taler-wallet-core/src/wallet.ts
parentbf9c2ae7f9c24168ddea2ef9387c5a624287d993 (diff)
downloadwallet-core-f51a59bc72c2886cb2bb88b149a3353857e3eb44.tar.gz
wallet-core-f51a59bc72c2886cb2bb88b149a3353857e3eb44.tar.bz2
wallet-core-f51a59bc72c2886cb2bb88b149a3353857e3eb44.zip
implement and test auto-refresh
Diffstat (limited to 'packages/taler-wallet-core/src/wallet.ts')
-rw-r--r--packages/taler-wallet-core/src/wallet.ts9
1 files changed, 8 insertions, 1 deletions
diff --git a/packages/taler-wallet-core/src/wallet.ts b/packages/taler-wallet-core/src/wallet.ts
index 5ca3581ad..21de541e5 100644
--- a/packages/taler-wallet-core/src/wallet.ts
+++ b/packages/taler-wallet-core/src/wallet.ts
@@ -373,7 +373,13 @@ export class Wallet {
private async runRetryLoopImpl(): Promise<void> {
while (!this.stopped) {
const pending = await this.getPendingOperations({ onlyDue: true });
- if (pending.pendingOperations.length === 0) {
+ let numDueAndLive = 0;
+ for (const p of pending.pendingOperations) {
+ if (p.givesLifeness) {
+ numDueAndLive++;
+ }
+ }
+ if (numDueAndLive === 0) {
const allPending = await this.getPendingOperations({ onlyDue: false });
let numPending = 0;
let numGivingLiveness = 0;
@@ -404,6 +410,7 @@ export class Wallet {
} else {
// FIXME: maybe be a bit smarter about executing these
// operations in parallel?
+ logger.trace(`running ${pending.pendingOperations.length} pending operations`);
for (const p of pending.pendingOperations) {
try {
await this.processOnePendingOperation(p);