modify: 重启失败bug

This commit is contained in:
2026-09-02 11:12:11 +08:00
parent abf4952e23
commit 67f45edc3c
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -4,7 +4,7 @@ requires = ["hatchling"]
[project] [project]
name = "chongming-worker" name = "chongming-worker"
version = "0.4.3" version = "0.4.4"
description = "chongming worker" description = "chongming worker"
readme = "README.md" readme = "README.md"
requires-python = ">=3.12" requires-python = ">=3.12"
+3
View File
@@ -997,6 +997,9 @@ async def _managed_worker(
""" """
while True: while True:
controller.exit_request = "" 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.current_worker_id = controller.make_worker_id()
controller.reload_cb = reload_cb controller.reload_cb = reload_cb
# 若存在待应用的新配置(config_set 设置),本次重建使用新配置运行 # 若存在待应用的新配置(config_set 设置),本次重建使用新配置运行