vorker icon indicating copy to clipboard operation
vorker copied to clipboard

Cron Triggers

Open shiny opened this issue 2 years ago • 4 comments

Are there any plans to add support for Cron Triggers?

shiny avatar Jul 18 '23 07:07 shiny

This feature will be added soon!

Cron trigger is not directly supported by the cloudflare's workerd readme file, but there's some way to implement this in vorker.

This feature is on the roadmap.

VaalaCat avatar Jul 18 '23 07:07 VaalaCat

seems that the cloudflare already implement this.

need some time to figure out how to use it

https://github.com/cloudflare/workerd/blob/262307f30c5a80e4a7608974bf6128f3bf20ca02/samples/durable-objects-chat/chat.js#L95

VaalaCat avatar Oct 14 '23 17:10 VaalaCat

In workers, usually the scheduled function gets called. It would be up to the code to decide if it calls the same function as fetch. This is an outdated example but it shows the code portion: https://github.com/kashalls/cloudflare-workers/blob/main/packages/cloudflare-status/src/index.ts#L24

kashalls avatar Jan 04 '24 23:01 kashalls

At present, the official documentation of workerd does not clearly explain how cron is used or triggered. Although they have a corresponding implementation on cloudflare worker, its open source version (workerd) does not give corresponding parameter (or configuration) instructions. It will take more time to figure out whether cloudflare will implement cron in the future (or if it has already been implemented).

If there is any progress about cron trigger, I will update the progress under this Issue.

VaalaCat avatar Jan 06 '24 06:01 VaalaCat