Skip to content

Commit

Permalink
get_connection: catch built-in ConnectionError too to recover from co…
Browse files Browse the repository at this point in the history
…nnection issues
  • Loading branch information
Enchufa2 committed Dec 24, 2021
1 parent 04b8d34 commit bdbded7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion redis/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,7 @@ def get_connection(self, command_name, *keys, **options):
try:
if connection.can_read():
raise ConnectionError("Connection has data")
except ConnectionError:
except (ConnectionError, OSError):
connection.disconnect()
connection.connect()
if connection.can_read():
Expand Down

0 comments on commit bdbded7

Please sign in to comment.