mirror of
https://github.com/ivan-usov-org/bec.git
synced 2025-04-22 02:20:02 +02:00
fix(redis_connector): unregister is not killing communication
This commit is contained in:
parent
d8f76f5057
commit
b31d506c9f
@ -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:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user