diff options
author | Andy McCurdy <andy@andymccurdy.com> | 2014-04-10 16:20:03 -0700 |
---|---|---|
committer | Andy McCurdy <andy@andymccurdy.com> | 2014-04-10 16:20:03 -0700 |
commit | f96e46b971a5bb66ab5f94ba87ab3e092e5f01ac (patch) | |
tree | 5f14946d117efb561859edccf43bdeedfc8eda14 /redis | |
parent | 8a49069d0259ac79e9122e4cf7c1579deac23905 (diff) | |
download | redis-py-f96e46b971a5bb66ab5f94ba87ab3e092e5f01ac.tar.gz |
mostly fixes #456. there's still an issue w/ hiredis and multi-bulk replies
Diffstat (limited to 'redis')
-rw-r--r-- | redis/client.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/redis/client.py b/redis/client.py index 91807b1..136aade 100644 --- a/redis/client.py +++ b/redis/client.py @@ -2257,12 +2257,15 @@ class BasePipeline(object): except ConnectionError: conn.disconnect() # if we're not already watching, we can safely retry the command - # assuming it was a connection timeout - if not self.watching: - conn.send_command(*args) - return self.parse_response(conn, command_name, **options) - self.reset() - raise + try: + if not self.watching: + conn.send_command(*args) + return self.parse_response(conn, command_name, **options) + except ConnectionError: + # the retry failed so cleanup. + conn.disconnect() + self.reset() + raise def pipeline_execute_command(self, *args, **options): """ |