(msg: str)
| 390 | def create_log_callback(self, task_uuid: str, prefix: str = "", batch_id: str = "") -> Callable[[str], None]: |
| 391 | """创建日志回调函数,可附加任务编号前缀,并同时推送到批量任务频道""" |
| 392 | def callback(msg: str): |
| 393 | full_msg = f"{prefix} {msg}" if prefix else msg |
| 394 | self.add_log(task_uuid, full_msg) |
| 395 | # 如果属于批量任务,同步推送到 batch 频道,前端可在混合日志中看到详细步骤 |
| 396 | if batch_id: |
| 397 | self.add_batch_log(batch_id, full_msg) |
| 398 | return callback |
| 399 | |
| 400 | def create_check_cancelled_callback(self, task_uuid: str) -> Callable[[], bool]: |
nothing calls this directly
no test coverage detected