fix(redis_connector): unregister is not killing communication

This commit is contained in:
wyzula_j 2024-04-25 15:57:55 +02:00
parent d8f76f5057
commit b31d506c9f

View File

@ -570,11 +570,13 @@ class RedisConnector(ConnectorBase):
fnmatch.filter(self._stream_topics_subscription, pattern), cb fnmatch.filter(self._stream_topics_subscription, pattern), cb
) )
pubsub_unsubscribe_list = self._filter_topics_cb(patterns, cb) pubsub_unsubscribe_list = self._filter_topics_cb(patterns, cb)
if pubsub_unsubscribe_list:
self._pubsub_conn.punsubscribe(pubsub_unsubscribe_list) self._pubsub_conn.punsubscribe(pubsub_unsubscribe_list)
else: else:
topics, _ = self._convert_endpointinfo(topics, check_message_op=False) topics, _ = self._convert_endpointinfo(topics, check_message_op=False)
if not self._unregister_stream(topics, cb): if not self._unregister_stream(topics, cb):
unsubscribe_list = self._filter_topics_cb(topics, cb) unsubscribe_list = self._filter_topics_cb(topics, cb)
if unsubscribe_list:
self._pubsub_conn.unsubscribe(unsubscribe_list) self._pubsub_conn.unsubscribe(unsubscribe_list)
def _unregister_stream(self, topics: list[str], cb: callable = None) -> bool: def _unregister_stream(self, topics: list[str], cb: callable = None) -> bool: