Browse Source

Catch TimeoutError (flake8 fixed)

pull/635/head
oxid 4 years ago
parent
commit
e94c040f2a
  1. 4
      socketio/redis_manager.py

4
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))

Loading…
Cancel
Save