测试修改
This commit is contained in:
@ -308,7 +308,7 @@ class PipelineExecutor(QObject):
|
||||
global_event_bus.publish('LogMessage', {'message': '开始执行完整流程...', 'level': 'info'})
|
||||
global_event_bus.publish('LogMessage', {'message': '=' * 50, 'level': 'info'})
|
||||
|
||||
# ★ 启动看门狗:worker.start() 之后立刻开始监控(180s 超时)
|
||||
# ★ 启动看门狗:worker.start() 之后立刻开始监控(600s 超时)
|
||||
import time
|
||||
self._last_progress_time = time.time()
|
||||
self._watchdog_timer.start(5000) # 每 5 秒巡检一次
|
||||
@ -385,7 +385,7 @@ class PipelineExecutor(QObject):
|
||||
})
|
||||
global_event_bus.publish('LogMessage', {'message': '=' * 50, 'level': 'info'})
|
||||
|
||||
# ★ 启动看门狗:worker.start() 之后立刻开始监控(180s 超时)
|
||||
# ★ 启动看门狗:worker.start() 之后立刻开始监控(600s 超时)
|
||||
import time
|
||||
self._last_progress_time = time.time()
|
||||
self._watchdog_timer.start(5000) # 每 5 秒巡检一次
|
||||
@ -515,14 +515,14 @@ class PipelineExecutor(QObject):
|
||||
|
||||
判定逻辑:
|
||||
- Worker 已不在运行(自然结束/被强杀) → 停掉看门狗
|
||||
- Worker 仍在运行 + 上次进度距今 > 180 秒 → 判定为假死/死锁,
|
||||
- Worker 仍在运行 + 上次进度距今 > 600 秒 → 判定为假死/死锁,
|
||||
强制 terminate() 并通过 _on_finished(False, ...) 汇流解 UI,
|
||||
让被卡死的「独立运行此步骤」按钮恢复可用。
|
||||
"""
|
||||
import time
|
||||
if self._worker and self._worker.isRunning():
|
||||
if time.time() - self._last_progress_time > 180:
|
||||
self._log_message("[错误] 后台任务响应超时(超过3分钟无响应),强制终止...", "error")
|
||||
if time.time() - self._last_progress_time > 600:
|
||||
self._log_message("[错误] 后台任务响应超时(超过10分钟无响应),强制终止...", "error")
|
||||
self._worker.terminate()
|
||||
self._on_finished(False, "后台任务响应超时或发生底层段错误,已强制终止。")
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user