From fab106aeeaa67fa7693e0c3c9fc26369945836b3 Mon Sep 17 00:00:00 2001 From: andy Date: Sun, 12 Jun 2011 18:28:19 +0200 Subject: [PATCH] disconnect the redis client if a ConnectionError occurs --- kombu/transport/pyredis.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kombu/transport/pyredis.py b/kombu/transport/pyredis.py index 5773a389..b15554b6 100644 --- a/kombu/transport/pyredis.py +++ b/kombu/transport/pyredis.py @@ -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