Skip to content

Commit

Permalink
raffles: try catch for revalidate failure
Browse files Browse the repository at this point in the history
  • Loading branch information
GGonryun committed Jul 28, 2024
1 parent 3a889ce commit 3596670
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions apps/charity/pages/api/cron/spawn-raffle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,17 @@ export default createCronJob(async (_, res) => {
await connectTweet(tweet, data, raffle);
}

await res.revalidate(
routes.raffle.path({
params: {
raffleId: raffle.id,
},
})
);
try {
await res.revalidate(
routes.raffle.path({
params: {
raffleId: raffle.id,
},
})
);
} catch (error) {
console.error('Error revalidating raffle', error);
}
});

const countActions = (raffle: Prisma.RaffleUncheckedCreateInput) => {
Expand Down

0 comments on commit 3596670

Please sign in to comment.