初始化批量任务
(self, batch_id: str, total: int)
| 234 | # ============== 批量任务管理 ============== |
| 235 | |
| 236 | def init_batch(self, batch_id: str, total: int): |
| 237 | """初始化批量任务""" |
| 238 | _batch_status[batch_id] = { |
| 239 | "status": "running", |
| 240 | "total": total, |
| 241 | "completed": 0, |
| 242 | "success": 0, |
| 243 | "failed": 0, |
| 244 | "skipped": 0, |
| 245 | "current_index": 0, |
| 246 | "finished": False |
| 247 | } |
| 248 | logger.info(f"批量任务 {batch_id} 已初始化,总数: {total}") |
| 249 | |
| 250 | def add_batch_log(self, batch_id: str, log_message: str): |
| 251 | """添加批量任务日志并推送""" |
no test coverage detected