fix: 一次保存学习配置,改代理后重开任务

This commit is contained in:
2026-11-16 11:13:45 +08:00
parent 556121a265
commit 7381b49e4c
11 changed files with 214 additions and 99 deletions
+8
View File
@@ -424,6 +424,14 @@ def sync_work(employee_id: str) -> None:
halt_work(key)
def restart_work(employee_id: str) -> None:
"""代理或学习配置变了,正在跑的这一轮先停掉,再按新配置评估。"""
key = (employee_id or "").strip()
if key and work_running(key):
halt_work(key)
sync_work(key)
_KIND_RANK = {"视频": 0, "文档": 1, "课程包": 2, "课程": 3}