Next.js Discord

Discord Forum

cron job revalidation only works manually

Unanswered
DeputyDawgDude posted this in #help-forum
Open in Discord
Hi there,

I have an events listing site that pulls content from a postgres db via prisma. I use unstable_cache for the queries on each route. Revalidation works fine when triggered during the server actions (publish, delete etc.).

I have a CRON job set up to revalidate all tags and paths each morning to clear the cache and only show events from the current date onwards. However, even though the logs show the CRON job is being called successfully, the old events still remain until I manually run the CRON in the vercel project settings page. I tried adding revalidate: revalidate: 86400 to the unstable_cache but this didn't take effect either.

Any ideas?

0 Replies