diff --git a/utils/odm_monitor.py b/utils/odm_monitor.py index 0a5fa3a..3001fcd 100644 --- a/utils/odm_monitor.py +++ b/utils/odm_monitor.py @@ -60,12 +60,13 @@ class ODMProcessMonitor: # 等待容器完成 result = container.wait() - + # 只在失败时获取日志 if result['StatusCode'] != 0: logs = container.logs().decode('utf-8') - self.logger.error(f"容器执行失败,最后100行日志:\n{''.join(logs.split('\n')[-100:])}") - + self.logger.error("容器执行失败,最后10行日志:") + self.logger.error(''.join(logs.split('\n')[-10:])) + # 检查是否成功完成 if result['StatusCode'] == 0 and self._check_success(grid_dir): self.logger.info(f"网格 {grid_idx + 1} ODM处理成功")