Browse Source

Reset message queue sleep timer upon reconnect

pull/657/head
Ed Serzo 4 years ago
committed by Miguel Grinberg
parent
commit
54180987cd
No known key found for this signature in database GPG Key ID: 36848B262DF5F06C
  1. 1
      socketio/asyncio_aiopika_manager.py
  2. 1
      socketio/asyncio_redis_manager.py
  3. 1
      socketio/redis_manager.py

1
socketio/asyncio_aiopika_manager.py

@ -89,6 +89,7 @@ class AsyncAioPikaManager(AsyncPubSubManager): # pragma: no cover
self.listener_queue = await self._queue(
self.listener_channel, exchange
)
retry_sleep = 1
async with self.listener_queue.iterator() as queue_iter:
async for message in queue_iter:

1
socketio/asyncio_redis_manager.py

@ -95,6 +95,7 @@ class AsyncRedisManager(AsyncPubSubManager): # pragma: no cover
password=self.password, ssl=self.ssl
)
self.ch = (await self.sub.subscribe(self.channel))[0]
retry_sleep = 1
return await self.ch.get()
except (aioredis.RedisError, OSError):
self._get_logger().error('Cannot receive from redis... '

1
socketio/redis_manager.py

@ -94,6 +94,7 @@ class RedisManager(PubSubManager): # pragma: no cover
if connect:
self._redis_connect()
self.pubsub.subscribe(self.channel)
retry_sleep = 1
for message in self.pubsub.listen():
yield message
except redis.exceptions.ConnectionError:

Loading…
Cancel
Save