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/withdraw.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/withdraw.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/withdraw.ts | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/packages/taler-wallet-core/src/operations/withdraw.ts b/packages/taler-wallet-core/src/operations/withdraw.ts index 9dfd72678..5729b8458 100644 --- a/packages/taler-wallet-core/src/operations/withdraw.ts +++ b/packages/taler-wallet-core/src/operations/withdraw.ts @@ -109,7 +109,7 @@ import { DbAccess, GetReadOnlyAccess } from "../util/query.js"; import { OperationAttemptResult, OperationAttemptResultType, - RetryTags, + TaskIdentifiers, } from "../util/retries.js"; import { WALLET_BANK_INTEGRATION_PROTOCOL_VERSION, @@ -1023,7 +1023,6 @@ export async function processWithdrawalGroup( ws: InternalWalletState, withdrawalGroupId: string, options: { - forceNow?: boolean; } = {}, ): Promise<OperationAttemptResult> { logger.trace("processing withdrawal group", withdrawalGroupId); @@ -1037,10 +1036,10 @@ export async function processWithdrawalGroup( throw Error(`withdrawal group ${withdrawalGroupId} not found`); } - const retryTag = RetryTags.forWithdrawal(withdrawalGroup); + const retryTag = TaskIdentifiers.forWithdrawal(withdrawalGroup); // We're already running! - if (ws.activeLongpoll[retryTag] && !options.forceNow) { + if (ws.activeLongpoll[retryTag]) { logger.info("withdrawal group already in long-polling, returning!"); return { type: OperationAttemptResultType.Longpoll, @@ -1532,7 +1531,7 @@ export async function getWithdrawalDetailsForUri( .iter(r.baseUrl) .toArray(); const retryRecord = await tx.operationRetries.get( - RetryTags.forExchangeUpdate(r), + TaskIdentifiers.forExchangeUpdate(r), ); if (exchangeDetails && denominations) { exchanges.push( @@ -2087,7 +2086,7 @@ export async function createManualWithdrawal( // rely on retry handling to re-process the withdrawal group. runOperationWithErrorReporting( ws, - RetryTags.forWithdrawal(withdrawalGroup), + TaskIdentifiers.forWithdrawal(withdrawalGroup), async () => { return await processWithdrawalGroup(ws, withdrawalGroupId, { forceNow: true, |