Browse Source

lint

pull/806/head
Sam Mosleh 4 years ago
parent
commit
7c9926e84e
  1. 7
      src/socketio/asyncio_redis_manager.py
  2. 7
      src/socketio/redis_manager.py

7
src/socketio/asyncio_redis_manager.py

@ -59,10 +59,11 @@ class AsyncRedisManager(AsyncPubSubManager): # pragma: no cover
async for message in self.pubsub.listen():
yield message['data']
except aioredis.exceptions.RedisError:
self._get_logger().error('Cannot receive from redis... '
'retrying in {} secs'.format(retry_sleep))
self._get_logger().error(
"Cannot receive from redis... "
"retrying in {} secs".format(retry_sleep)
)
await asyncio.sleep(retry_sleep)
retry_sleep *= 2
if retry_sleep > 60:
retry_sleep = 60

7
src/socketio/redis_manager.py

@ -1,4 +1,3 @@
import logging
import pickle
import time
@ -76,8 +75,10 @@ class RedisManager(PubSubManager): # pragma: no cover
for message in self.pubsub.listen():
yield message['data']
except redis.exceptions.RedisError:
self._get_logger().error('Cannot receive from redis... '
'retrying in {} secs'.format(retry_sleep))
self._get_logger().error(
"Cannot receive from redis... "
"retrying in {} secs".format(retry_sleep)
)
time.sleep(retry_sleep)
retry_sleep *= 2
if retry_sleep > 60:

Loading…
Cancel
Save