Fix2 the issues with #9538

Signed-off-by: root <root@localhost.localdomain>
This commit is contained in:
root 2024-10-28 08:54:23 +08:00
parent 198f2be1a5
commit d66ae4ae12

View File

@ -73,11 +73,10 @@ def init_app(app):
master = sentinel.master_for(dify_config.REDIS_SENTINEL_SERVICE_NAME, **redis_params)
redis_client.initialize(master)
elif dify_config.REDIS_USE_CLUSTERS:
startup_nodes = [
{"host": node.split(":")[0], "port": int(node.split(":")[1])}
nodes = [
ClusterNode(host=node.split(":")[0], port=int(node.split.split(":")[1]))
for node in dify_config.REDIS_CLUSTERS.split(",")
]
nodes = [ClusterNode(host=node["host"], port=node["port"]) for node in startup_nodes]
redis_client.initialize(RedisCluster(startup_nodes=nodes, password=dify_config.REDIS_CLUSTERS_PASSWORD))
else:
redis_params.update(