Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Mini RFC: Cron Triggers #1574

Closed
ObsidianMinor opened this issue Sep 28, 2020 · 7 comments · Fixed by #1592
Closed

Mini RFC: Cron Triggers #1574

ObsidianMinor opened this issue Sep 28, 2020 · 7 comments · Fixed by #1592
Assignees
Labels
feature Feature requests and suggestions

Comments

@ObsidianMinor
Copy link
Contributor

ObsidianMinor commented Sep 28, 2020

Cron triggers are out, but there isn't a way to configure them from wrangler. To support cron triggers, I propose we add a new triggers table with a crons field as an array of strings.

Example

name = "scheduled"
type = "javascript"
account_id = "..."

[triggers]
crons = ["* * * * *"]
name = "weekly"
type = "javascript"
account_id = "..."

[triggers]
crons = ["0 0 * JAN-JUN FRI", "0 0 * JUL-DEC SAT"]
@ObsidianMinor ObsidianMinor self-assigned this Sep 28, 2020
@ObsidianMinor ObsidianMinor added the feature Feature requests and suggestions label Sep 28, 2020
@ObsidianMinor
Copy link
Contributor Author

cc: @ashleymichal

@xtuc
Copy link
Member

xtuc commented Sep 28, 2020

Since webpack doesn't allow emitting JavaScript modules syntax yet we should probably restrict to type javascript only

@ObsidianMinor
Copy link
Contributor Author

ObsidianMinor commented Sep 28, 2020

Since webpack doesn't allow emitting JavaScript modules syntax yet we should probably restrict to type javascript only

We still support the original addEventListener form so this works without module support.

@simonhaenisch
Copy link
Contributor

My scheduled worker doesn't need workers_dev but also doesn't need a route/routes because it only handles 'scheduled' events. I currently have to leave workers_dev = true, otherwise I'll get "Error: No deploy target specified" when trying to publish my worker.

Thus: triggers should be considered a deploy target as well 🤓

@ObsidianMinor
Copy link
Contributor Author

Yeah, part of this work will be making multiple target deployments possible instead of exclusively zoned or zoneless.

@oliverpool
Copy link
Contributor

Currently the dashboard indicates

If this Worker is managed by Wrangler, add Cron Triggers via CLI commands or to your wrangler.toml file instead.

image

However if I understand this issue correctly, this is not yet supported by wrangler.toml.

Do you have an estimate when this will be possible? (and maybe change the dashboard hint in the meantime...)

@ObsidianMinor
Copy link
Contributor Author

@oliverpool I'm working full time on it, so it should be a PR sometime this week. You're also right that the dash is incorrect and I've submitted changes to remove that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature Feature requests and suggestions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants