Skip to content

Commit

Permalink
trying updated version of worker (connection syntax was deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Learner authored and Sam Learner committed Dec 27, 2024
1 parent de77765 commit 9b194cb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,20 @@
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


listen = ['high', 'default', 'low']

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)

0 comments on commit 9b194cb

Please sign in to comment.