Browse Source

Configure Redis pubsub to skip subscription messages

pull/844/head
Miguel Grinberg 3 years ago
parent
commit
e8fff07b36
No known key found for this signature in database GPG Key ID: 36848B262DF5F06C
  1. 2
      src/socketio/asyncio_redis_manager.py
  2. 2
      src/socketio/redis_manager.py

2
src/socketio/asyncio_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

2
src/socketio/redis_manager.py

@ -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

Loading…
Cancel
Save