-
Notifications
You must be signed in to change notification settings - Fork 46
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 seconds option to interval_units with tests #29
Conversation
This looks good to me, though one area of concern I have is that rq-scheduler only once per minute adds tasks to the queues. Having the seconds granularity on this may mislead people into thinking that the scheduled time of the repeatable task also works with such precision. |
Thanks for the review @tom-price, that's a good point about confusion. If a user was to schedule a task every x seconds they would need to run rq-scheduler like so: |
(cherry picked from commit 83cc432)
I'm still torn on this. I don't think your suggestion of how to update the readme fits. The
I also don't think that failing silently is an option if the interval set on the job is lower than the scheduler's interval, or maybe isn't even a multiple of the interval frequency (unsure about that part). In
|
Rejects when a job's interval is lower than a queue's interval. Rejects when a job's interval is not a multiple of a queue's interval. This seemed to be the most restrictive approach from which things can be loosened up. Added a settings parameter DJANGO_RQ_SCHEDULER_INTERVAL that can be used to change the schedular interval. Default is 60 matching DJANGO_RQ's default. Renamed migration adding seconds to be more descriptive.
Merge in main repo updates
I think the code looks good. |
@g3rd Thanks for checking this out, do you think the rq-scheduler interval issue needs to be fixed by this PR or just a disclaimer before this is merged? |
Seconds interval units
@g3rd The rq-scheduler interval issue has been resolved on this PR by @tom-price If everything looks good could you please merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately this merge cbd6d13 introduced a 2nd migration 0006_{migration name}.py breaking this PR.
Merge changes from isl-x master repo
merge back
Seconds interval units
@tom-price I have merged in your PR that resolves the duplicate migration. At @divipayhq we have been running this branch in production for nearly 12 months and have not seen any issues with the interval being in the realm of a few seconds. I'd love to see this released as the next version, please let me know if anything is needed @g3rd |
Fixes #28
'seconds'
option toRepeatableJob.UNITS