diff options
author | andy <andy@whiskeymedia.com> | 2011-07-22 11:09:53 -0700 |
---|---|---|
committer | andy <andy@whiskeymedia.com> | 2011-07-22 11:09:53 -0700 |
commit | dbd2217746eeb81950e91c556bb393e95aca5582 (patch) | |
tree | c964b3cb32f5e1bb9066f0b942ed70c1b04f3798 /redis/connection.py | |
parent | 907555c786a108a97643b9ceb35cabda6119e01f (diff) | |
download | redis-py-dbd2217746eeb81950e91c556bb393e95aca5582.tar.gz |
Removed socket retry logic in Connection. This is the responsbility of the caller to determine if the command is safe and can be retried.
Diffstat (limited to 'redis/connection.py')
-rw-r--r-- | redis/connection.py | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/redis/connection.py b/redis/connection.py index ff7f277..a85129b 100644 --- a/redis/connection.py +++ b/redis/connection.py @@ -174,8 +174,8 @@ class Connection(object): pass self._sock = None - def _send(self, command): - "Send the command to the socket" + def send_packed_command(self, command): + "Send an already packed command to the Redis server" if not self._sock: self.connect() try: @@ -190,17 +190,6 @@ class Connection(object): raise ConnectionError("Error %s while writing to socket. %s." % \ (_errno, errmsg)) - def send_packed_command(self, command): - "Send an already packed command to the Redis server" - try: - self._send(command) - except ConnectionError: - # retry the command once in case the socket connection simply - # timed out - self.disconnect() - # if this _send() call fails, then the error will be raised - self._send(command) - def send_command(self, *args): "Pack and send a command to the Redis server" self.send_packed_command(self.pack_command(*args)) |