From bf1b8aaf70627dbc57e90e6cf6c3e5ab3f80a196 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 14 Jan 2024 21:27:08 +0100 Subject: [PATCH] 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. --- platypush/backend/http/app/mixins/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/platypush/backend/http/app/mixins/__init__.py b/platypush/backend/http/app/mixins/__init__.py index eec40e6b1f..b036e1e0d5 100644 --- a/platypush/backend/http/app/mixins/__init__.py +++ b/platypush/backend/http/app/mixins/__init__.py @@ -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: