disconnect the redis client if a ConnectionError occurs

This commit is contained in:
andy 2011-06-12 18:28:19 +02:00
parent a9bd9ebc8b
commit fab106aeea
1 changed files with 3 additions and 0 deletions

View File

@ -214,6 +214,9 @@ class Channel(virtual.Channel):
"BRPOP",
**options)
except self.connection.connection_errors:
# if there's a ConnectionError, disconnect so the next
# iteration will reconnect automatically.
self.client.connection.disconnect()
raise Empty()
if dest__item:
dest, item = dest__item