fix: update retry info before return
This commit is contained in:
parent
145714b335
commit
5595e942b4
@ -245,6 +245,7 @@ async function runBackupCycleForProvider(
|
||||
ws: InternalWalletState,
|
||||
args: BackupForProviderArgs,
|
||||
): Promise<void> {
|
||||
|
||||
const provider = await ws.db
|
||||
.mktx((x) => ({ backupProviders: x.backupProviders }))
|
||||
.runReadOnly(async (tx) => {
|
||||
|
@ -149,6 +149,8 @@ async function processDepositGroupImpl(
|
||||
} = {},
|
||||
): Promise<void> {
|
||||
const forceNow = options.forceNow ?? false;
|
||||
await setupDepositGroupRetry(ws, depositGroupId, { resetRetry: forceNow });
|
||||
|
||||
const depositGroup = await ws.db
|
||||
.mktx((x) => ({
|
||||
depositGroups: x.depositGroups,
|
||||
@ -165,8 +167,6 @@ async function processDepositGroupImpl(
|
||||
return;
|
||||
}
|
||||
|
||||
await setupDepositGroupRetry(ws, depositGroupId, { resetRetry: forceNow });
|
||||
|
||||
const contractData = extractContractData(
|
||||
depositGroup.contractTermsRaw,
|
||||
depositGroup.contractTermsHash,
|
||||
|
@ -556,6 +556,8 @@ async function updateExchangeFromUrlImpl(
|
||||
}> {
|
||||
const forceNow = options.forceNow ?? false;
|
||||
logger.info(`updating exchange info for ${baseUrl}, forced: ${forceNow}`);
|
||||
await setupExchangeUpdateRetry(ws, baseUrl, { reset: forceNow });
|
||||
|
||||
const now = AbsoluteTime.now();
|
||||
baseUrl = canonicalizeBaseUrl(baseUrl);
|
||||
|
||||
@ -574,8 +576,6 @@ async function updateExchangeFromUrlImpl(
|
||||
return { exchange, exchangeDetails };
|
||||
}
|
||||
|
||||
await setupExchangeUpdateRetry(ws, baseUrl, { reset: forceNow });
|
||||
|
||||
logger.info("updating exchange /keys info");
|
||||
|
||||
const timeout = getExchangeRequestTimeout();
|
||||
|
@ -672,6 +672,8 @@ async function processDownloadProposalImpl(
|
||||
} = {},
|
||||
): Promise<void> {
|
||||
const forceNow = options.forceNow ?? false;
|
||||
await setupProposalRetry(ws, proposalId, { reset: forceNow });
|
||||
|
||||
const proposal = await ws.db
|
||||
.mktx((x) => ({ proposals: x.proposals }))
|
||||
.runReadOnly(async (tx) => {
|
||||
@ -686,8 +688,6 @@ async function processDownloadProposalImpl(
|
||||
return;
|
||||
}
|
||||
|
||||
await setupProposalRetry(ws, proposalId, { reset: forceNow });
|
||||
|
||||
const orderClaimUrl = new URL(
|
||||
`orders/${proposal.orderId}/claim`,
|
||||
proposal.merchantBaseUrl,
|
||||
|
@ -1022,6 +1022,8 @@ export async function autoRefresh(
|
||||
exchangeBaseUrl: string,
|
||||
): Promise<void> {
|
||||
logger.info(`doing auto-refresh check for '${exchangeBaseUrl}'`);
|
||||
|
||||
//updateExchangeFromUrl will also update retryInfo for this operation
|
||||
await updateExchangeFromUrl(ws, exchangeBaseUrl, {
|
||||
forceNow: true,
|
||||
});
|
||||
|
@ -205,23 +205,6 @@ export async function processTip(
|
||||
);
|
||||
}
|
||||
|
||||
async function resetTipRetry(
|
||||
ws: InternalWalletState,
|
||||
tipId: string,
|
||||
): Promise<void> {
|
||||
await ws.db
|
||||
.mktx((x) => ({
|
||||
tips: x.tips,
|
||||
}))
|
||||
.runReadWrite(async (tx) => {
|
||||
const x = await tx.tips.get(tipId);
|
||||
if (x) {
|
||||
x.retryInfo = RetryInfo.reset();
|
||||
await tx.tips.put(x);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function processTipImpl(
|
||||
ws: InternalWalletState,
|
||||
walletTipId: string,
|
||||
@ -230,9 +213,8 @@ async function processTipImpl(
|
||||
} = {},
|
||||
): Promise<void> {
|
||||
const forceNow = options.forceNow ?? false;
|
||||
if (forceNow) {
|
||||
await resetTipRetry(ws, walletTipId);
|
||||
}
|
||||
await setupTipRetry(ws, walletTipId, { reset: forceNow });
|
||||
|
||||
const tipRecord = await ws.db
|
||||
.mktx((x) => ({
|
||||
tips: x.tips,
|
||||
|
Loading…
Reference in New Issue
Block a user