mirror of
https://gitee.com/mao-peng/MangoTestingPlatform.git
synced 2025-12-06 11:59:15 +08:00
fix(auto_system): 修复停止调度器时未判断调度器状态的问题
- 增加判断调度器是否处于运行状态后再调用 shutdown - 防止未运行调度器调用 shutdown 导致异常 - 优化异常捕获时的日志信息 - 提高停止调度器函数的健壮性
This commit is contained in:
@@ -209,7 +209,7 @@ class AutoSystemConfig(AppConfig):
|
||||
def stop_scheduler(self):
|
||||
"""停止调度器"""
|
||||
try:
|
||||
if hasattr(self, 'scheduler') and self.scheduler:
|
||||
if hasattr(self, 'scheduler') and self.scheduler and self.scheduler.running:
|
||||
self.scheduler.shutdown()
|
||||
except Exception as e:
|
||||
log.system.error(f'停止调度器异常: {e}')
|
||||
|
||||
Reference in New Issue
Block a user