Skip to content

Commit e823776

Browse files
committed
Merged pull request redis#132 from banjiewen/banjiewen.
Added socket disconnection if commands are rejected due to AOF/RDB load.
2 parents bbf8cc5 + b1651ba commit e823776

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

redis/connection.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ def read_response(self, command_name, catch_errors):
9797
if byte == '-':
9898
if response.startswith('ERR '):
9999
response = response[4:]
100+
if response.startswith('LOADING '):
101+
# If we're loading the dataset into memory, kill the socket
102+
# so we re-initialize (and re-SELECT) next time.
103+
self.disconnect()
104+
response = response[8:]
100105
raise ResponseError(response)
101106
# single value
102107
elif byte == '+':

0 commit comments

Comments
 (0)