mirror of
https://github.com/langgenius/dify.git
synced 2026-02-24 09:55:09 +00:00
chore(api): add some log to ensure that the patch actually works
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user