Browse Source
Configure Redis pubsub to skip subscription messages
pull/844/head
Miguel Grinberg
3 years ago
No known key found for this signature in database
GPG Key ID: 36848B262DF5F06C
2 changed files with
2 additions and
2 deletions
-
src/socketio/asyncio_redis_manager.py
-
src/socketio/redis_manager.py
|
|
@ -51,7 +51,7 @@ class AsyncRedisManager(AsyncPubSubManager): # pragma: no cover |
|
|
|
def _redis_connect(self): |
|
|
|
self.redis = aioredis.Redis.from_url(self.redis_url, |
|
|
|
**self.redis_options) |
|
|
|
self.pubsub = self.redis.pubsub() |
|
|
|
self.pubsub = self.redis.pubsub(ignore_subscribe_messages=True) |
|
|
|
|
|
|
|
async def _publish(self, data): |
|
|
|
retry = True |
|
|
|
|
|
@ -70,7 +70,7 @@ class RedisManager(PubSubManager): # pragma: no cover |
|
|
|
def _redis_connect(self): |
|
|
|
self.redis = redis.Redis.from_url(self.redis_url, |
|
|
|
**self.redis_options) |
|
|
|
self.pubsub = self.redis.pubsub() |
|
|
|
self.pubsub = self.redis.pubsub(ignore_subscribe_messages=True) |
|
|
|
|
|
|
|
def _publish(self, data): |
|
|
|
retry = True |
|
|
|