Skip to content

Commit

Permalink
raffles: extend cron job transaction timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
GGonryun committed Aug 18, 2024
1 parent 8407e95 commit 7295d69
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apps/charity/pages/api/cron/find-expired-raffles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
} from '@worksheets/services/raffles';
import { createCronJob } from '@worksheets/util/cron';
import { retryTransaction } from '@worksheets/util/prisma';
import { SECONDS } from '@worksheets/util/time';

export default createCronJob(async () => {
const notifications = new NotificationsService(prisma);
Expand All @@ -27,6 +28,11 @@ export default createCronJob(async () => {
async (tx) => {
const raffles = new RafflesService(tx);
return await raffles.processExpiredRaffle(expired);
},
{
maxAttempts: 5,
maxWait: 60 * SECONDS,
timeout: 180 * SECONDS,
}
);
console.info(`Processed expired raffle ${expired.id}.`);
Expand Down

0 comments on commit 7295d69

Please sign in to comment.