From e94c040f2a32f3cd844e00613658d3142fa2b214 Mon Sep 17 00:00:00 2001 From: oxid Date: Wed, 10 Feb 2021 20:34:32 +0300 Subject: [PATCH] Catch TimeoutError (flake8 fixed) --- socketio/redis_manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/socketio/redis_manager.py b/socketio/redis_manager.py index 83093e8..6d4d2c7 100644 --- a/socketio/redis_manager.py +++ b/socketio/redis_manager.py @@ -78,7 +78,7 @@ class RedisManager(PubSubManager): # pragma: no cover if not retry: self._redis_connect() return self.redis.publish(self.channel, pickle.dumps(data)) - except (redis.exceptions.ConnectionError, + except (redis.exceptions.ConnectionError, redis.exceptions.TimeoutError): if retry: logger.error('Cannot publish to redis... retrying') @@ -97,7 +97,7 @@ class RedisManager(PubSubManager): # pragma: no cover self.pubsub.subscribe(self.channel) for message in self.pubsub.listen(): yield message - except (redis.exceptions.ConnectionError, + except (redis.exceptions.ConnectionError, redis.exceptions.TimeoutError) as e: logger.error('Cannot receive from redis ({})... ' 'retrying in {} secs'.format(e, retry_sleep))