Delete pubsub closure to _pubsub_close().

The Redis channel may be closed, and in that case we need to handle the
exception instead of throwing it - which causes the upstream Tornado
worker to fail too.
This commit is contained in:
Fabio Manganiello 2024-01-14 21:27:08 +01:00
parent 6fe1ed44ad
commit bf1b8aaf70
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -65,8 +65,7 @@ class PubSubMixin:
with self._pubsub_lock:
# Close and free the pub/sub object if it has no active subscriptions.
if self._pubsub is not None and len(self._subscriptions) == 0:
self._pubsub.close()
self._pubsub = None
self._pubsub_close()
@staticmethod
def _serialize(data: MessageType) -> bytes: