chore(api): add some log to ensure that the patch actually works

This commit is contained in:
QuantumGhost
2026-02-10 18:17:08 +08:00
parent 641f833177
commit 06fa39b4b8
2 changed files with 6 additions and 0 deletions

View File

@@ -28,6 +28,7 @@ class RedisSubscriptionBase(Subscription):
topic: str,
):
# The _pubsub is None only if the subscription is closed.
_logger.info("Client type for redis connection: type=%s, topic=%s", type(client), topic)
self._client = client
self._pubsub: PubSub | None = pubsub
self._topic = topic
@@ -79,6 +80,7 @@ class RedisSubscriptionBase(Subscription):
exc_info=True,
)
break
_logger.info("Message is none for subscription: ", self._topic)
if raw_message is None:
continue

View File

@@ -1,5 +1,7 @@
from __future__ import annotations
import logging
from libs.broadcast_channel.channel import Producer, Subscriber, Subscription
from redis import Redis, RedisCluster
@@ -75,6 +77,8 @@ class _RedisShardedSubscription(RedisSubscriptionBase):
#
# Here we specify the `target_node` to mitigate this problem.
node = self._client.get_node_from_key(self._topic)
logger = logging.getLogger(__name__)
logger.info("node retrieved from client: %s", node)
return self._pubsub.get_sharded_message( # type: ignore[attr-defined]
ignore_subscribe_messages=False,
timeout=1,