From 9b194cb7752894a57f700a8b71264fdc71cb100d Mon Sep 17 00:00:00 2001 From: Sam Learner Date: Thu, 26 Dec 2024 23:40:02 -0500 Subject: [PATCH] trying updated version of worker (connection syntax was deprecated --- worker.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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)