Periodic database update in Cloudflare Pages project

For Workes & Pages, what is the name of the domain?

.com

What is the issue or error you’re encountering

unsure what product to use

What steps have you taken to resolve the issue?

I have a cloudflare Pages project which uses Sveltekit, typescript, Kysely orm and D1 for the database.
In this project I have “Task” objects that have deadlines and I want a function to run every minute or so to check if any deadlines expired and if yes, create a database entry.
I am now unsure which product to use for this.
Is it best to use Cloudflare functions or workers for this?
Ideally I would like a solution where I can just create an extra typescript function in a file in my pages project and say that this should run periodically.
In that way I could use the same code as I am using in the pages.

You’ll need a separate Worker that uses Cron Triggers. Unfortunately Pages Functions can’t use cron, so it will need to be its own Worker.

ok, thank you for the advice! I will use a Worker then.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.