diff --git a/worker.py b/worker.py index 94ec6c5..489fe87 100644 --- a/worker.py +++ b/worker.py @@ -2,7 +2,7 @@ from urllib.parse import urlparse import redis # from redis import Redis -from rq import Worker, Queue, Connection +from rq import Worker, Queue # from rq.command import send_kill_horse_command @@ -10,9 +10,12 @@ redis_url = os.getenv('REDISCLOUD_URL', 'redis://localhost:6379') conn = redis.from_url(redis_url) +queues = [Queue(x, connection=conn) for x in listen] if __name__ == '__main__': - with Connection(conn): - worker = Worker(map(Queue, listen)) - worker.work() + worker = Worker(queues, connection=conn) + worker.work() + # with Connection(conn): + # worker = Worker(map(Queue, listen)) + # worker.work() # send_kill_horse_command(redis, worker.name)