-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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 JS-friendly API for specifying Deno.cron schedule #21122
Comments
I would like to handle this issue if it's okay by you. Still a beginner to open source though but I feel like I can try it out |
While I wait to be assigned to this issue, I'd like to say I am currently working on this for anyone who might want to hop on as well. Thanks |
Thanks @Cedar-81 |
Quick questions can you give more information about the schedule string, you've stated that it can accept minute, hour, date_of_week, but there are 2 asterisks left. If there is any resource I can use to understand the schedule string better it would be really helpful cause I'd need to reconstruct the schedule string from the passed in object so I need to understand its format. |
It's a standard cron schedule string. See https://en.wikipedia.org/wiki/Cron. |
okay, thanks. |
on a side note there is a npm package which helps to abstract that string: |
I want to pick this task @igorzi. Where exactly are we writing test cases for corn? |
Sounds good, @raashidanwar! Please check with @Cedar-81. Current cron tests are here: https://github.com/denoland/deno/blob/main/cli/tests/unit/cron_test.ts |
Sorry for not attending to this for so long, funny enough I have actually implemented this but I couldnt run tests because I had some problems setting up Rust and according to the Docs I needed to run all tests. Feel free to go ahead as I am currently swamped with some other tasks. Thanks a lot for this opportunity and sorry again for not reaching out for so long. |
Hi @igorzi 👋 . Here is the draft PR #21340. Do have a look. |
Currently
Deno.cron()
2nd argument is a string, which specifies the schedule using the cron format.We'd like to extend this with a JS-friendly API, which allows the schedule to be specified using Javascript object literals. The conversion should happen in https://github.com/denoland/deno/blob/main/ext/cron/01_cron.ts.
Here are some examples:
Exact
becomes:
Every nth
becomes:
List of schedules
becomes:
The text was updated successfully, but these errors were encountered: