From c67d0bff1daa35d380d1d71b94428a5026b56450 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Wed, 18 May 2022 14:41:51 -0300 Subject: all retryInfo function in the same namespace, adding missing retryInfo increment --- packages/taler-wallet-core/src/operations/exchanges.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'packages/taler-wallet-core/src/operations/exchanges.ts') diff --git a/packages/taler-wallet-core/src/operations/exchanges.ts b/packages/taler-wallet-core/src/operations/exchanges.ts index 72cbdc15b..b10505b27 100644 --- a/packages/taler-wallet-core/src/operations/exchanges.ts +++ b/packages/taler-wallet-core/src/operations/exchanges.ts @@ -63,7 +63,7 @@ import { readSuccessResponseTextOrThrow, } from "../util/http.js"; import { DbAccess, GetReadOnlyAccess } from "../util/query.js"; -import { resetRetryInfo, RetryInfo } from "../util/retries.js"; +import { RetryInfo } from "../util/retries.js"; import { WALLET_CACHE_BREAKER_CLIENT_VERSION, WALLET_EXCHANGE_PROTOCOL_VERSION, @@ -116,6 +116,9 @@ async function reportExchangeUpdateError( if (!exchange) { return; } + if (!exchange.retryInfo) { + logger.reportBreak(); + } exchange.lastError = err; await tx.exchanges.put(exchange); }); @@ -137,7 +140,7 @@ async function setupExchangeUpdateRetry( return; } if (options.reset) { - exchange.retryInfo = resetRetryInfo(); + exchange.retryInfo = RetryInfo.reset(); } else { exchange.retryInfo = RetryInfo.increment(exchange.retryInfo); } @@ -399,7 +402,7 @@ async function provideExchangeRecord( const r: ExchangeRecord = { permanent: true, baseUrl: baseUrl, - retryInfo: resetRetryInfo(), + retryInfo: RetryInfo.reset(), detailsPointer: undefined, lastUpdate: undefined, nextUpdate: AbsoluteTime.toTimestamp(now), -- cgit v1.2.3