Flask-RQ2
Flask-RQ2 copied to clipboard
Add remaining CLI args for flask rq worker.
This resolves #121
@Jacoberts I tried this in my fork of the repository but the --with-scheduler
argument doesn't seem to create a scheduler that works - the logs say a scheduler has started, but it doesn't seem to pick up any jobs:
Worker rq:worker:f2a74e6c9b7c4aee811a62f7aac2e9c7: started, version 1.13.0
Subscribing to channel rq:pubsub:f2a74e6c9b7c4aee811a62f7aac2e9c7
*** Listening on default...
Scheduler for default started with PID 9
When I brought my dedicated scheduler online the jobs started processing again. I'm not sure where the issue is exactly though.
Hi @matt-takumi, I have always found the RQ scheduler to be a little mysterious, and have avoided it for that reason. I looked into this error a little, and found that, based on your logs, the --with-scheduler flag is correctly being recognized:
- your logs show that the "run(scheduler)" is being evoked
- that function is only ever started in a separate process
- that process is only started when the
with_scheduler
is true
My only remaining hypothesis: are your jobs on the default
queue?
It's an interesting problem, because after adding the scheduled jobs via the flask-rq2 decorator they were picked up by the dedicated scheduler, but not via the one with the worker. I'll do some more exploration and feedback.