From f1cba79c656875af0c6a09fd8e03b2c94fb2ac44 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Fri, 14 Oct 2022 21:00:13 +0200 Subject: wallet-core: DB tweaks --- packages/taler-wallet-core/src/operations/refresh.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'packages/taler-wallet-core/src/operations/refresh.ts') diff --git a/packages/taler-wallet-core/src/operations/refresh.ts b/packages/taler-wallet-core/src/operations/refresh.ts index a5951ea53..83ab32f20 100644 --- a/packages/taler-wallet-core/src/operations/refresh.ts +++ b/packages/taler-wallet-core/src/operations/refresh.ts @@ -60,6 +60,7 @@ import { OperationStatus, RefreshCoinStatus, RefreshGroupRecord, + RefreshOperationStatus, WalletStoresV1, } from "../db.js"; import { TalerError } from "../errors.js"; @@ -139,10 +140,11 @@ function updateGroupStatus(rg: RefreshGroupRecord): void { ); if (allDone) { if (anyFrozen) { - rg.frozen = true; + rg.timestampFinished = AbsoluteTime.toTimestamp(AbsoluteTime.now()); + rg.operationStatus = RefreshOperationStatus.FinishedWithError; } else { rg.timestampFinished = AbsoluteTime.toTimestamp(AbsoluteTime.now()); - rg.operationStatus = OperationStatus.Finished; + rg.operationStatus = RefreshOperationStatus.Finished; } } } @@ -917,7 +919,7 @@ export async function createRefreshGroup( } const refreshGroup: RefreshGroupRecord = { - operationStatus: OperationStatus.Pending, + operationStatus: RefreshOperationStatus.Pending, timestampFinished: undefined, statusPerCoin: oldCoinPubs.map(() => RefreshCoinStatus.Pending), lastErrorPerCoin: {}, @@ -933,7 +935,7 @@ export async function createRefreshGroup( if (oldCoinPubs.length == 0) { logger.warn("created refresh group with zero coins"); refreshGroup.timestampFinished = TalerProtocolTimestamp.now(); - refreshGroup.operationStatus = OperationStatus.Finished; + refreshGroup.operationStatus = RefreshOperationStatus.Finished; } await tx.refreshGroups.put(refreshGroup); -- cgit v1.2.3