binarymatt / pyres

a resque clone in python
http://github.com/binarydud/pyres
MIT License
955 stars 130 forks source link

Queue names with colons (":") break things #58

Open follower opened 13 years ago

follower commented 13 years ago

If I start a worker with:

pyres_worker "project-name:queue-name"

Then visit http://127.0.0.1:8080/workers/ the web interface breaks with:

Application Error

This is due to:

File "pyres-0.9.1-py2.7.egg/resweb/views.py", line 142, in workers
  host,pid,queues = str(w).split(':')
ValueError: too many values to unpack

Also, if a start another worker at the same time with:

pyres_worker "project-name:queue-name"

It breaks with:

File "pyres-0.9.1-py2.7.egg/pyres/worker.py", line 86, in startup
  self.prune_dead_workers()
File "pyres-0.9.1-py2.7.egg/pyres/worker.py", line 76, in prune_dead_workers
  host, pid, queues = worker.id.split(':')
ValueError: too many values to unpack

I would guess this happens in other places also.

It would be nice to be able to specify a queue name that includes a colon (":").

A fix in some places might be something like:

foo.split(':', 2)
binarymatt commented 13 years ago

the problem with this is that currently, the keys are namespaced in redis by using a colon. I might mark this as something to do when we refactor and allow arbitraty namespaces.

bryanrasmussen commented 11 years ago

Has this been done? If so do I set my queue variable to be named "project-name:queue-name"?

binarymatt commented 11 years ago

this is not currently implemented. I am working on a branch for allowing arbitrary namespaces that should help with this issues