summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy McCurdy <andy@andymccurdy.com>2011-04-26 16:52:13 -0700
committerAndy McCurdy <andy@andymccurdy.com>2011-04-26 16:52:13 -0700
commite8237761204971ac0b6d9b723de5a49ca58dcd7a (patch)
tree1ad6bca466830b4a1e32b33b37188d4f4677a0d2
parentbbf8cc53c71c3cde9223f9414fb7b12ae24d6248 (diff)
parentb1651bab349004fffe6460f7fbb306ea6e2c4dc8 (diff)
downloadredis-py-e8237761204971ac0b6d9b723de5a49ca58dcd7a.tar.gz
Merged pull request #132 from banjiewen/banjiewen.
Added socket disconnection if commands are rejected due to AOF/RDB load.
-rw-r--r--redis/connection.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/redis/connection.py b/redis/connection.py
index e317e85..85b4a7c 100644
--- a/redis/connection.py
+++ b/redis/connection.py
@@ -97,6 +97,11 @@ class PythonConnection(BaseConnection):
if byte == '-':
if response.startswith('ERR '):
response = response[4:]
+ if response.startswith('LOADING '):
+ # If we're loading the dataset into memory, kill the socket
+ # so we re-initialize (and re-SELECT) next time.
+ self.disconnect()
+ response = response[8:]
raise ResponseError(response)
# single value
elif byte == '+':