binarymatt / pyres

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

'Redis' object has no attribute 'disconnect' #64

Closed srounet closed 13 years ago

srounet commented 13 years ago

There is an issue calling close method from ResQ object.

>>> from pyres import ResQ
>>> r = ResQ()
>>> r.close()
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/fabienr/venv/lib/python2.7/site-packages/pyres/__init__.py", line 229, in close
    self.redis.disconnect()
AttributeError: 'Redis' object has no attribute 'disconnect'
>>> 

I looked at source code and found that it may be instead :

r.redis.connection.disconnect()

but calling that method has no side effect, i can still enqueue jobs and use ResQ object the same way.

binarymatt commented 13 years ago

if I remember correctly, disconnect closes the socket; however, the way the redis object works, it will lazily open a socket on an operation. I'll update this in the 1.01 branch.

binarymatt commented 13 years ago

fixed and merged into release/1.0.1