rq / rq-scheduler

A lightweight library that adds job scheduling capabilities to RQ (Redis Queue)
MIT License
1.45k stars 229 forks source link

Scheduled jobs not executed when using Redis on Heroku #254

Closed gruffaren closed 3 years ago

gruffaren commented 3 years ago

It seems scheduled jobs are not run when using Redis on Heroku.

When creating the jobs using the admin panel I can see that they are created. From django I see output using:

        scheduler = django_rq.get_scheduler("default")
        scheduled_jobs = scheduler.get_jobs()
        print(scheduled_jobs)

but the nothing shows up in the redis logs (note I am running rqworker with the --with-scheduler parameter set.

Any clues?

Thanks in advance!

graphman65 commented 3 years ago

Hi,

This project is not about the scheduler packaged into https://github.com/rq/rq. It's a scheduler that needs to be run on its own.

You can see here how to do so: https://github.com/rq/rq-scheduler#running-the-scheduler Here's the django_rq doc about starting the rqscheduler: https://github.com/rq/django-rq#support-for-rq-scheduler

It seems that django_rq doesn't support the new RQ integrated scheduler so you need to use the docs above and remove the --with-scheduler option.

gruffaren commented 3 years ago

Hi Graphman65,

Thank you a lot for these pointers, was able to make it work with:

rqscheduler --host localhost --port <port_nr>

also found out that I can run it with the manage.py script:

python3 manage.py rqscheduler

and then it takes the redis config as specified in settings.py.

Hope this can also help someone else :)