Skip to content

Commit 18ea2a5

Browse files
authored
Retry Transaction Fix (#327)
* updates * deleting the commented out code
1 parent 226e0e8 commit 18ea2a5

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

src/db/transactions/getTxToRetry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ WHERE
2929
AND "transactionHash" IS NOT NULL
3030
AND "retryCount" < ${config.maxRetriesPerTx}
3131
ORDER BY
32-
"queuedAt"
32+
"nonce"
3333
ASC
3434
LIMIT
3535
1

src/worker/tasks/retryTx.ts

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,6 @@ export const retryTx = async () => {
8181
`[Transaction] [${tx.id}] Failed to retry with error - ${err}`,
8282
);
8383

84-
await updateTx({
85-
pgtx,
86-
queueId: tx.id,
87-
data: {
88-
status: TransactionStatusEnum.Errored,
89-
errorMessage:
90-
err?.message ||
91-
err?.toString() ||
92-
`Failed to handle transaction`,
93-
},
94-
});
95-
9684
return;
9785
}
9886

@@ -108,7 +96,9 @@ export const retryTx = async () => {
10896
},
10997
});
11098

111-
logger.worker.info(`[Transaction] [${tx.id}] Retried`);
99+
logger.worker.info(
100+
`[Transaction] [${tx.id}] Retried with hash ${res.hash} for Nonce ${res.nonce}`,
101+
);
112102
},
113103
{
114104
timeout: 5 * 60000,

0 commit comments

Comments
 (0)