diff --git a/api/extensions/ext_redis.py b/api/extensions/ext_redis.py index 410ebaf4bf..1e0ad59689 100644 --- a/api/extensions/ext_redis.py +++ b/api/extensions/ext_redis.py @@ -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(