aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/operations/exchanges.ts
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2022-05-18 14:41:51 -0300
committerSebastian <sebasjm@gmail.com>2022-05-18 14:41:51 -0300
commitc67d0bff1daa35d380d1d71b94428a5026b56450 (patch)
treeb4e1f164e1bed3b13fa4ff5969806d2212079f41 /packages/taler-wallet-core/src/operations/exchanges.ts
parentd3a857743dd9ed2f7350bb64af8808729156edba (diff)
downloadwallet-core-c67d0bff1daa35d380d1d71b94428a5026b56450.tar.xz
all retryInfo function in the same namespace, adding missing retryInfo increment
Diffstat (limited to 'packages/taler-wallet-core/src/operations/exchanges.ts')
-rw-r--r--packages/taler-wallet-core/src/operations/exchanges.ts9
1 files changed, 6 insertions, 3 deletions
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),