in redis/cluster.py [0:0]
def write(self):
"""
Code borrowed from Redis so it can be fixed
"""
connection = self.connection
commands = self.commands
# We are going to clobber the commands with the write, so go ahead
# and ensure that nothing is sitting there from a previous run.
for c in commands:
c.result = None
# build up all commands into a single request to increase network perf
# send all the commands and catch connection and timeout errors.
try:
connection.send_packed_command(
connection.pack_commands([c.args for c in commands])
)
except (ConnectionError, TimeoutError) as e:
for c in commands:
c.result = e