Skip to content

Commit 8bbab0b

Browse files
authored
Retry Fix (#170)
* retry fixed * reetry query updated
1 parent 33f0576 commit 8bbab0b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/db/transactions/getTxToRetry.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Transactions } from "@prisma/client";
22
import type { PrismaTransaction } from "../../schema/prisma";
3+
import { env } from "../../utils/env";
34
import { getPrismaWithPostgresTx } from "../client";
45

56
interface GetTxToRetryParams {
@@ -25,7 +26,7 @@ WHERE
2526
AND "minedAt" IS NULL
2627
AND "errorMessage" IS NULL
2728
AND "transactionHash" IS NOT NULL
28-
AND "retryCount" < 3
29+
AND "retryCount" < ${env.MAX_RETRIES_FOR_TX}
2930
ORDER BY
3031
"sentAt"
3132
ASC

src/worker/tasks/retryTx.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const retryTx = async () => {
3434
return;
3535
}
3636

37-
const receipt = sdk
37+
const receipt = await sdk
3838
.getProvider()
3939
.getTransactionReceipt(tx.transactionHash!);
4040

0 commit comments

Comments
 (0)