otto otto - 20 days ago 6
Python Question

Delete a Queue from Python-RQ / Redis

I'm using Python RQ (backed by Redis) to feed tasks to a bunch of worker processes.

I accidentally sent a tuple when adding a job to a queue, so now I have queues like this:

high
medium
low
('low',)
default


I can't seem to figure out how to get rid of the
('low',)
queue. The queue also seems to cause some issues due to its name (for instance, I couldn't view it or clear it in rq-dashboard as the page would refuse to load).

There is some discussion here: RQ - Empty & Delete Queues, but that only covers emptying a queue. I am able to empty the queue just fine from within Python, but I can't seem to actually delete the queue from the Redis server.

The RQ documentation doesn't seem to provide any information on getting rid of a queue you don't want.

I want to actually delete that queue (not just empty it) instead of carrying it around forever.

Answer

The RQ stores all the queues under rq:queues keys. This can be accessed by the redis-cli.

smembers rq:queues

I also stumbled upon Destroying / removing a Queue() in Redis Queue (rq) programmatically This might help!

Comments