diff options
| author | Andy McCurdy <andy@andymccurdy.com> | 2011-04-26 16:52:13 -0700 |
|---|---|---|
| committer | Andy McCurdy <andy@andymccurdy.com> | 2011-04-26 16:52:13 -0700 |
| commit | e8237761204971ac0b6d9b723de5a49ca58dcd7a (patch) | |
| tree | 1ad6bca466830b4a1e32b33b37188d4f4677a0d2 | |
| parent | bbf8cc53c71c3cde9223f9414fb7b12ae24d6248 (diff) | |
| parent | b1651bab349004fffe6460f7fbb306ea6e2c4dc8 (diff) | |
| download | redis-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.py | 5 |
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 == '+': |
