aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/pending.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2022-05-31 15:44:22 +0200
committerFlorian Dold <florian@dold.me>2022-05-31 15:44:22 +0200
commit59bc54422f3e9aa7a487705489f6755e02ff5c0a (patch)
treec61337bbcd01ed03ea110d3e90d3bfec128fbddc /packages/taler-wallet-core/src/operations/pending.ts
parent2e6f3b356971f3a56ff78db0ea6fa75ce0ab85b2 (diff)
downloadwallet-core-59bc54422f3e9aa7a487705489f6755e02ff5c0a.tar.xz
wallet-core: only schedule auto-refresh check if exchange update has no last error
Diffstat (limited to 'packages/taler-wallet-core/src/operations/pending.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/pending.ts18
1 files changed, 10 insertions, 8 deletions
diff --git a/packages/taler-wallet-core/src/operations/pending.ts b/packages/taler-wallet-core/src/operations/pending.ts
index b89c7c640..0a262d3bb 100644
--- a/packages/taler-wallet-core/src/operations/pending.ts
+++ b/packages/taler-wallet-core/src/operations/pending.ts
@@ -57,14 +57,16 @@ async function gatherExchangePending(
lastError: e.lastError,
});
- resp.pendingOperations.push({
- type: PendingTaskType.ExchangeCheckRefresh,
- timestampDue:
- e.retryInfo?.nextRetry ??
- AbsoluteTime.fromTimestamp(e.nextRefreshCheck),
- givesLifeness: false,
- exchangeBaseUrl: e.baseUrl,
- });
+ // We only schedule a check for auto-refresh if the exchange update
+ // was successful.
+ if (!e.lastError) {
+ resp.pendingOperations.push({
+ type: PendingTaskType.ExchangeCheckRefresh,
+ timestampDue: AbsoluteTime.fromTimestamp(e.nextRefreshCheck),
+ givesLifeness: false,
+ exchangeBaseUrl: e.baseUrl,
+ });
+ }
});
}