From c0e6b6d0f66508ebc8d33502d1281cb48a1c9cc6 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 19 Aug 2021 15:12:33 +0200 Subject: run pending operations at least once, style fixes --- packages/taler-wallet-core/src/operations/refresh.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (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 2549b1404..20b07d44e 100644 --- a/packages/taler-wallet-core/src/operations/refresh.ts +++ b/packages/taler-wallet-core/src/operations/refresh.ts @@ -147,6 +147,7 @@ async function refreshCreateSession( throw Error("db inconsistent: exchange of coin not found"); } + const { availableAmount, availableDenoms } = await ws.db .mktx((x) => ({ denominations: x.denominations, @@ -161,6 +162,7 @@ async function refreshCreateSession( throw Error("db inconsistent: denomination for coin not found"); } + // FIXME: use an index here, based on the withdrawal expiration time. const availableDenoms: DenominationRecord[] = await tx.denominations.indexes.byExchangeBaseUrl .iter(exchange.baseUrl) .toArray(); @@ -913,7 +915,15 @@ export async function autoRefresh( } } if (refreshCoins.length > 0) { - await createRefreshGroup(ws, tx, refreshCoins, RefreshReason.Scheduled); + const res = await createRefreshGroup( + ws, + tx, + refreshCoins, + RefreshReason.Scheduled, + ); + logger.info( + `created refresh group for auto-refresh (${res.refreshGroupId})`, + ); } logger.info( `current wallet time: ${timestampToIsoString(getTimestampNow())}`, -- cgit v1.2.3