RQScheduler on Heroku
Asked Answered
V

2

7

I'm trying to run rqscheduler with django-rq on Heroku with RedisToGo. I've implemented django-rq as described in their readme (https://github.com/ui/django-rq).

I have a worker that starts an rqworker, and another worker that starts up rqscheduler using the management command suggested in the readme. The rqworker starts up successfully, but I keep running into this error with rqscheduler:

redis.exceptions.ConnectionError: Error 111 connecting to localhost:6379. Connection refused.

In my settings, I have this configuration for the my Redis Queues:

RQ_QUEUES = {
'default': {
    'HOST': 'localhost',
    'PORT': 6379,
    'DB': 0,
    'PASSWORD': '*****',
    'DEFAULT_TIMEOUT': 500,
},
'high': {
    'URL': os.getenv('REDISTOGO_URL', 'redis://localhost:6379/0'), # If you're on Heroku
    'DEFAULT_TIMEOUT': 500,
},
'low': {
    'HOST': 'localhost',
    'PORT': 6379,
    'DB': 0,
}
}

and I have this in my Procfile:

web: gunicorn app.wsgi --log-file -
worker: python manage.py rqworker high
scheduler: python manage.py rqscheduler

Any thoughts on why this might be happening?

Vibraphone answered 12/12, 2016 at 23:4 Comment(0)
V
5

If this is relevant to anyone, simple answer to the problem. Use the argument --queue when running the scheduler management command like this:

python manage.py rqscheduler --queue high
Vibraphone answered 15/12, 2016 at 18:16 Comment(0)
K
0

I got this same error, and didn't have a Redis queues configuration. I was able to get it working by providing the Redis url:

rqscheduler --url $REDISTOGO_URL
Krystynakshatriya answered 16/9, 2021 at 15:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.