Update telegram bot implementation.

This commit is contained in:
2026-01-18 06:21:18 +08:00
parent 94145f7dd0
commit 4ca15d9f01

View File

@@ -805,6 +805,12 @@ class ProvisionerBot:
self.current_team = None self.current_team = None
# 清理进度跟踪 # 清理进度跟踪
progress_finish() progress_finish()
# 重置停止标志,以便下次任务可以正常运行
try:
import run
run._shutdown_requested = False
except Exception:
pass
def _run_team_task(self, team_idx: int): def _run_team_task(self, team_idx: int):
"""执行单个 Team 任务 (在线程池中运行)""" """执行单个 Team 任务 (在线程池中运行)"""
@@ -871,13 +877,8 @@ class ProvisionerBot:
# 4. 重置状态 # 4. 重置状态
self.current_team = None self.current_team = None
# 5. 重置停止标志 (以便下次任务可以正常运行) # 注意:不在这里重置 _shutdown_requested让任务完成后在 _wrap_task 中重置
try: # 这样可以确保线程池中的任务有足够时间检测到停止信号
import run
run._shutdown_requested = False
except Exception:
pass
# 清理进度跟踪 # 清理进度跟踪
progress_finish() progress_finish()