diff --git a/src/db/transactions/getTxToRetry.ts b/src/db/transactions/getTxToRetry.ts index 675a13659..daab11d51 100644 --- a/src/db/transactions/getTxToRetry.ts +++ b/src/db/transactions/getTxToRetry.ts @@ -1,5 +1,6 @@ import { Transactions } from "@prisma/client"; import type { PrismaTransaction } from "../../schema/prisma"; +import { env } from "../../utils/env"; import { getPrismaWithPostgresTx } from "../client"; interface GetTxToRetryParams { @@ -25,7 +26,7 @@ WHERE AND "minedAt" IS NULL AND "errorMessage" IS NULL AND "transactionHash" IS NOT NULL - AND "retryCount" < 3 + AND "retryCount" < ${env.MAX_RETRIES_FOR_TX} ORDER BY "sentAt" ASC diff --git a/src/worker/tasks/retryTx.ts b/src/worker/tasks/retryTx.ts index 0755dfda1..1524c302c 100644 --- a/src/worker/tasks/retryTx.ts +++ b/src/worker/tasks/retryTx.ts @@ -34,7 +34,7 @@ export const retryTx = async () => { return; } - const receipt = sdk + const receipt = await sdk .getProvider() .getTransactionReceipt(tx.transactionHash!);