diff options
author | Florian Dold <florian@dold.me> | 2022-10-14 21:00:13 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2022-10-14 22:10:10 +0200 |
commit | f1cba79c656875af0c6a09fd8e03b2c94fb2ac44 (patch) | |
tree | 469036c26f2ab84a5db218dd8833c38560c09e3d /packages/taler-wallet-core/src/operations/refresh.ts | |
parent | 398e79d0d6b649d8921ffffa4d0be8775c15626e (diff) | |
download | wallet-core-f1cba79c656875af0c6a09fd8e03b2c94fb2ac44.tar.xz |
wallet-core: DB tweaks
Diffstat (limited to 'packages/taler-wallet-core/src/operations/refresh.ts')
-rw-r--r-- | packages/taler-wallet-core/src/operations/refresh.ts | 10 |
1 files changed, 6 insertions, 4 deletions
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); |