VaalaCat / vorker

🔥🔥Vorker is a simple self host cloudflare worker alternative which built with cloudflare's workerd🔥🔥
https://vaala.cat/2023/06/03/Vorker%E5%BC%80%E5%8F%91%E7%AC%94%E8%AE%B0-%E8%87%AA%E5%BB%BA%E7%9A%84%E4%BA%91%E5%87%BD%E6%95%B0%E5%B9%B3%E5%8F%B0/
114 stars 4 forks source link

Cron Triggers #6

Open shiny opened 1 year ago

shiny commented 1 year ago

Are there any plans to add support for Cron Triggers?

VaalaCat commented 1 year ago

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 commented 11 months ago

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

kashalls commented 8 months ago

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

VaalaCat commented 8 months ago

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.