fix: update retry info before return also for purchase

This commit is contained in:
Sebastian 2022-05-18 16:39:36 -03:00
parent 5595e942b4
commit 611a57ca0a
No known key found for this signature in database
GPG Key ID: BE4FF68352439FC1

View File

@ -1540,6 +1540,7 @@ async function processPurchasePayImpl(
} = {}, } = {},
): Promise<ConfirmPayResult> { ): Promise<ConfirmPayResult> {
const forceNow = options.forceNow ?? false; const forceNow = options.forceNow ?? false;
await setupPurchasePayRetry(ws, proposalId, { reset: forceNow });
const purchase = await ws.db const purchase = await ws.db
.mktx((x) => ({ purchases: x.purchases })) .mktx((x) => ({ purchases: x.purchases }))
.runReadOnly(async (tx) => { .runReadOnly(async (tx) => {
@ -1562,7 +1563,6 @@ async function processPurchasePayImpl(
lastError: purchase.lastPayError, lastError: purchase.lastPayError,
}; };
} }
await setupPurchasePayRetry(ws, proposalId, { reset: forceNow });
logger.trace(`processing purchase pay ${proposalId}`); logger.trace(`processing purchase pay ${proposalId}`);
const sessionId = purchase.lastSessionId; const sessionId = purchase.lastSessionId;