From 67f45edc3cd4bf1744d14d141615664d5b967736 Mon Sep 17 00:00:00 2001 From: chakcy <947105045@qq.com> Date: Wed, 2 Sep 2026 11:12:11 +0800 Subject: [PATCH] =?UTF-8?q?modify:=20=E9=87=8D=E5=90=AF=E5=A4=B1=E8=B4=A5b?= =?UTF-8?q?ug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 2 +- src/chongming_worker/runtime.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8208e84..cd5e83d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ requires = ["hatchling"] [project] name = "chongming-worker" -version = "0.4.3" +version = "0.4.4" description = "chongming worker" readme = "README.md" requires-python = ">=3.12" diff --git a/src/chongming_worker/runtime.py b/src/chongming_worker/runtime.py index 168fe62..61ab40d 100644 --- a/src/chongming_worker/runtime.py +++ b/src/chongming_worker/runtime.py @@ -997,6 +997,9 @@ async def _managed_worker( """ while True: controller.exit_request = "" + # control_event 为槽位级共享事件:上次 config_set/restart 置位后若不清除, + # 本次重建的副本会立即唤醒 exit_event.wait() 并以 stop 退出,导致副本数 -1。 + controller.control_event.clear() controller.current_worker_id = controller.make_worker_id() controller.reload_cb = reload_cb # 若存在待应用的新配置(config_set 设置),本次重建使用新配置运行