diff options
author | Florian Dold <florian@dold.me> | 2023-02-20 20:14:37 +0100 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2023-02-20 20:14:46 +0100 |
commit | 3daa4dbb3fc5199fb05d58b40c0d7c9ee287595e (patch) | |
tree | bdf3bcd9af71ce9cc77a8c4dc32ff0537654e83f /packages/taler-wallet-core/src/operations/common.ts | |
parent | 7bb81a008b7148cfd3fd656f858e4cbd755531ac (diff) | |
download | wallet-core-3daa4dbb3fc5199fb05d58b40c0d7c9ee287595e.tar.xz |
wallet-core: fix retryTransaction, improve tx/op identifier parsing/construction
Diffstat (limited to 'packages/taler-wallet-core/src/operations/common.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/common.ts | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/operations/common.ts b/packages/taler-wallet-core/src/operations/common.ts index 35e6455bc..e5eda074c 100644 --- a/packages/taler-wallet-core/src/operations/common.ts +++ b/packages/taler-wallet-core/src/operations/common.ts @@ -218,6 +218,23 @@ export async function storeOperationError( }); } +export async function resetOperationTimeout( + ws: InternalWalletState, + pendingTaskId: string, +): Promise<void> { + await ws.db + .mktx((x) => [x.operationRetries]) + .runReadWrite(async (tx) => { + let retryRecord = await tx.operationRetries.get(pendingTaskId); + if (retryRecord) { + // Note that we don't reset the lastError, it should still be visible + // while the retry runs. + retryRecord.retryInfo = RetryInfo.increment(retryRecord.retryInfo); + await tx.operationRetries.put(retryRecord); + } + }); +} + export async function storeOperationPending( ws: InternalWalletState, pendingTaskId: string, |