mirror of
https://github.com/hibiken/asynq.git
synced 2026-04-25 23:15:51 +03:00
[GH-ISSUE #447] [FEATURE REQUEST] Expose an option to change standard cron parser for a scheduler #206
Labels
No labels
CLI
bug
designing
documentation
duplicate
enhancement
good first issue
good first issue
help wanted
idea
invalid
investigate
needs-more-info
performance
pr-welcome
pull-request
question
wontfix
work in progress
work in progress
work-around-available
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/asynq#206
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SergeyNSW on GitHub (May 4, 2022).
Original GitHub issue: https://github.com/hibiken/asynq/issues/447
Originally assigned to: @hibiken on GitHub.
Is your feature request related to a problem? Please describe.
I'd like to have an ability to run a job every N seconds, the cron package used behind the scene allows to have extended (with seconds) or custom schedule parser, but the async uses default one.
Describe the solution you'd like
Is it possible to extend the asynq.SchedulerOpts so that it would accept custom cron.ScheduleParser and pass it as an option to the cron instance?
Thanks
@hibiken commented on GitHub (May 10, 2022):
@SergeyNSW thank you for this issue!
It makes sense to me. We probably don't want to directly expose the
cron.SchedulerParsersince that would complicate the versioning, but since theSchedulerParseris defined with interfaces we can simply expose that same and pass it tocronpackage behind the scene. Let me work on this soon 👍@SergeyNSW commented on GitHub (May 10, 2022):
Thank you, looking forward to this improvement.
@hibiken commented on GitHub (Jun 4, 2022):
Upon looking, it seems like spec like
"@every 30s"works without a custom schedule parser. Does that work for you?@SergeyNSW commented on GitHub (Jun 6, 2022):
yes, it works for me, thanks
@acaloiaro commented on GitHub (Apr 6, 2023):
Hi @hibiken -- I know this issue is closed, but I think it might be worth considering a different option, which some users might find less surprising:
In
scheduler.goWhich allows users to supply their cronspecs with the full six fields
* * * * * *