-
-
Notifications
You must be signed in to change notification settings - Fork 285
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 cron support via --with-scheduler #594
Comments
This is correct.
I'd also love to bring in cron capabilities into RQ's core. The problem with the current cron system in RQ scheduler is that at times the same job can be executed simultaneously by two different workers. For example, if I have a job that runs for 5 minutes each, but is cronned to run once every minute. RQ jobs are not designed to be run by different workers simultaneously. So to solve this, what we'll need to have in RQ is some kind of job template system that when cron'ed will create actual jobs to be picked up by workers. |
Does that mean if there is just a single worker scheduling |
There's actually some progress on this. I decided to tackle this with a different approach. This PR will allow jobs to track multiple simultaneous executions. Once this is done, we can start planning on bringing cron like capabilities into RQ. |
After seeing that cron like jobs could only be registered using rq-scheduler, I found that I couldn't see them in the django-rq admin interface (which states explicitly that rq-scheduler jobs are not displayed). After diving through source code I found that rq-scheduler and rq.scheduler use different redis keys to store the job of scheduled jobs. Would it be enough to change the rq-scheduler Redis key so the jobs would be displayed using django-rq in the Scheduled Jobs section? |
@selwin since I'm poking around on here, I'd like to pick your brain / propose a feature:
Running
rqworker
with the--with-scheduler
option is tremendous (enqueue_at
andenqueue_in
are great).However (and this is assuming that I haven't misunderstood the docs), setting up cron tasks still also requires rq-scheduler. What would it take to support running a single
manage.py rqworker --with-scheduler
process to get everything (enqueue_at
,enqueue_in
, andcron
)? I'd be happy to help with this, if it's something you think would fit within the system.This would be really great, especially when running in a Docker container (vs needing Supervisor to run both).
P.S. sorry for the duplicate post (wrong user)
The text was updated successfully, but these errors were encountered: