From 9b0c81333f803299f57a6f368f45bd76cea45044 Mon Sep 17 00:00:00 2001 From: ibuler Date: Thu, 17 Oct 2024 10:14:33 +0800 Subject: [PATCH] perf: debug pub sub --- apps/common/utils/connection.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/common/utils/connection.py b/apps/common/utils/connection.py index cbe961968..5ec4f95b2 100644 --- a/apps/common/utils/connection.py +++ b/apps/common/utils/connection.py @@ -47,6 +47,7 @@ class Subscription: self.ch = pb.ch self.sub = sub self.unsubscribed = False + logger.info("Subscribed to channel: ", sub) def _handle_msg(self, _next, error, complete): """ @@ -105,10 +106,11 @@ class Subscription: def unsubscribe(self): self.unsubscribed = True + logger.info("Unsubscribed from channel: ", self.sub) try: self.sub.close() except Exception as e: - logger.debug('Unsubscribe msg error: {}'.format(e)) + logger.warning('Unsubscribe msg error: {}'.format(e)) def retry(self, _next, error, complete): logger.info('Retry subscribe channel: {}'.format(self.ch))