Revert "revert: revert human input relevant code (#31766)"

This reverts commit 90fe9abab7.
This commit is contained in:
QuantumGhost
2026-02-01 16:13:36 +08:00
parent 7828508b30
commit 8ca020e179
470 changed files with 32468 additions and 2053 deletions

View File

@ -104,6 +104,7 @@ class TestCelerySSLConfiguration:
def test_celery_init_applies_ssl_to_broker_and_backend(self):
"""Test that SSL options are applied to both broker and backend when using Redis."""
mock_config = MagicMock()
mock_config.HUMAN_INPUT_TIMEOUT_TASK_INTERVAL = 1
mock_config.CELERY_BROKER_URL = "redis://localhost:6379/0"
mock_config.CELERY_BACKEND = "redis"
mock_config.CELERY_RESULT_BACKEND = "redis://localhost:6379/0"

View File

@ -0,0 +1,20 @@
from configs import dify_config
from extensions import ext_redis
from libs.broadcast_channel.redis.channel import BroadcastChannel as RedisBroadcastChannel
from libs.broadcast_channel.redis.sharded_channel import ShardedRedisBroadcastChannel
def test_get_pubsub_broadcast_channel_defaults_to_pubsub(monkeypatch):
monkeypatch.setattr(dify_config, "PUBSUB_REDIS_CHANNEL_TYPE", "pubsub")
channel = ext_redis.get_pubsub_broadcast_channel()
assert isinstance(channel, RedisBroadcastChannel)
def test_get_pubsub_broadcast_channel_sharded(monkeypatch):
monkeypatch.setattr(dify_config, "PUBSUB_REDIS_CHANNEL_TYPE", "sharded")
channel = ext_redis.get_pubsub_broadcast_channel()
assert isinstance(channel, ShardedRedisBroadcastChannel)