My project includes an API route that fetches data from my DataBase. This particular API route is triggered by a CRON job set up in Vercel.
After each build of the project, new data gets added to the database. I suspect this might be due to NextJS pre-executing an endpoint to cache it. How can I prevent unwanted data additions in my Database?
You can find the code snippet here: https://github.com/guifeliper/dart-throwing-monkey-crypto/blob/main/apps/monkey-crypto/app/api/generateTokens/route.ts
export const revalidate = 60 * 60 * 24 * 6; // every 6 days
export async function GET(request: Request) {
// Add your logic here...
}