diff options
author | Florian Dold <florian@dold.me> | 2022-03-29 13:47:32 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-03-29 13:48:51 +0200 |
commit | c265e7d019d445add2d2cfb7cfcbdeee059684d3 (patch) | |
tree | 6904e9cdb723992728ed511103be65094ca50034 /packages/taler-wallet-core/src/operations/pending.ts | |
parent | be489b6b3ea4214f546dfc33d6bb0f39ce82b5ab (diff) | |
download | wallet-core-c265e7d019d445add2d2cfb7cfcbdeee059684d3.tar.xz |
wallet: make retries more robust and consistent
Diffstat (limited to 'packages/taler-wallet-core/src/operations/pending.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/pending.ts | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/packages/taler-wallet-core/src/operations/pending.ts b/packages/taler-wallet-core/src/operations/pending.ts index 71b8b34f4..b89c7c640 100644 --- a/packages/taler-wallet-core/src/operations/pending.ts +++ b/packages/taler-wallet-core/src/operations/pending.ts @@ -51,18 +51,17 @@ async function gatherExchangePending( resp.pendingOperations.push({ type: PendingTaskType.ExchangeUpdate, givesLifeness: false, - timestampDue: e.lastError - ? e.retryInfo.nextRetry - : AbsoluteTime.fromTimestamp(e.nextUpdate), + timestampDue: + e.retryInfo?.nextRetry ?? AbsoluteTime.fromTimestamp(e.nextUpdate), exchangeBaseUrl: e.baseUrl, lastError: e.lastError, }); resp.pendingOperations.push({ type: PendingTaskType.ExchangeCheckRefresh, - timestampDue: e.lastError - ? e.retryInfo.nextRetry - : AbsoluteTime.fromTimestamp(e.nextRefreshCheck), + timestampDue: + e.retryInfo?.nextRetry ?? + AbsoluteTime.fromTimestamp(e.nextRefreshCheck), givesLifeness: false, exchangeBaseUrl: e.baseUrl, }); |