aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/common.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-core/src/operations/common.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/common.ts17
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,