取消批量任务
(self, batch_id: str)
| 337 | return status.get("cancelled", False) |
| 338 | |
| 339 | def cancel_batch(self, batch_id: str): |
| 340 | """取消批量任务""" |
| 341 | if batch_id in _batch_status: |
| 342 | _batch_status[batch_id]["cancelled"] = True |
| 343 | _batch_status[batch_id]["status"] = "cancelling" |
| 344 | logger.info(f"批量任务 {batch_id} 已标记为取消") |
| 345 | |
| 346 | def register_batch_websocket(self, batch_id: str, websocket): |
| 347 | """注册批量任务 WebSocket 连接""" |