Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for cron shortcuts #807

Open
mattchenderson opened this issue Nov 3, 2022 · 2 comments
Open

Add support for cron shortcuts #807

mattchenderson opened this issue Nov 3, 2022 · 2 comments

Comments

@mattchenderson
Copy link

Dapr does a nice thing where they support a few alternatives to cron expressions, such as "@daily" or "@every 5m". See https://docs.dapr.io/reference/components-reference/supported-bindings/cron/

This is a great way to simplify setup for common cases. Supporting something like this would make it easier for folks to get started with TimerTrigger. Getting started templates / examples should probably move to a default here. If someone needs something more advanced, they can switch to use the classic cron expression pattern.

@ghost ghost added the Needs: Triage 🔍 label Nov 3, 2022
@mattchenderson
Copy link
Author

Noting a requirement specific to Functions - all SKUs should get this. Either the scaling infrastructure will need to update accordingly or something needs to be done in the metadata generation / synctriggers to convert these shortcuts into the right cron expressions

@mathewc
Copy link
Member

mathewc commented Nov 4, 2022

So we'd be doing a limited set of conversions, e.g.:

"@every 15s" => "*/15 * * * * *"
"@every 20m" => "0 */20 * * * *"
"@every 2h" => "0 0 */2 * * *"
"@daily" => "0 0 0 * * *"
"@hourly" => "0 0 * * * *"

I think we'd just have a shared converter that both the Timer extension and ScaleController use to do these conversions, leaving the actual schedule expression unmodified in the trigger payload/metadata.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants