summaryrefslogtreecommitdiff
path: root/redis/client.py
diff options
context:
space:
mode:
authorhofmockel <dreagonfly@gmx.de>2013-04-17 15:30:00 +0200
committerhofmockel <dreagonfly@gmx.de>2013-04-17 15:30:00 +0200
commit01237e9efacf0f46fdf1adce502db152085fd7c1 (patch)
treee8ff6e3b4b6cbca141427ec81ebbd7376fded515 /redis/client.py
parent6d38b56db85b821cc5ef86527fcb1497deb80ad9 (diff)
downloadredis-py-01237e9efacf0f46fdf1adce502db152085fd7c1.tar.gz
Read all command responses of a pipeline
Otherwise a error makes the responses stuck in the socket. Which leads to wrong responses for the following commands
Diffstat (limited to 'redis/client.py')
-rw-r--r--redis/client.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/redis/client.py b/redis/client.py
index a3359ae..e135776 100644
--- a/redis/client.py
+++ b/redis/client.py
@@ -1781,8 +1781,15 @@ class BasePipeline(object):
starmap(connection.pack_command,
[args for args, options in commands]))
connection.send_packed_command(all_cmds)
- response = [self.parse_response(connection, args[0], **options)
- for args, options in commands]
+
+ response = []
+ for args, options in commands:
+ try:
+ response.append(
+ self.parse_response(connection, args[0], **options))
+ except ResponseError as error:
+ response.append(error)
+
if raise_on_error:
self.raise_first_error(response)
return response