From 71ede0ac69036406a275547f1373bce4f42a7cc5 Mon Sep 17 00:00:00 2001 From: zhaoxi Date: Tue, 28 Apr 2026 15:18:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BA=86=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 4796e34..8494a91 100644 --- a/main.py +++ b/main.py @@ -1,6 +1,6 @@ import asyncio import ray - +from pretor.worker_individual.worker_cluster import WorkerCluster from pretor.utils.banner import print_banner from pretor.core.database.postgres import PostgresDatabase from pretor.core.global_state_machine.global_state_machine import GlobalStateMachine @@ -56,6 +56,14 @@ async def start_system(): consciousness_node = ConsciousnessNode.options(name='consciousness_node').remote() control_node = ControlNode.options(name='control_node').remote() + try: + worker_cluster_actor = WorkerCluster.options( + name="worker_cluster", + lifetime="detached" # 保证它在后台一直运行 + ).remote() + print("✅ WorkerCluster 已成功启动并注册!") + except ValueError: + print("WorkerCluster 已经存在。") # 5. 启动工作流运行引擎 workflow_engine = WorkflowRunningEngine.options(name='workflow_running_engine').remote( consciousness_node=consciousness_node,