MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / update_status

Method update_status

src/web/task_manager.py:205–221  ·  view source on GitHub ↗

更新任务状态

(self, task_uuid: str, status: str, **kwargs)

Source from the content-addressed store, hash-verified

203 return _log_queues.get(task_uuid, []).copy()
204
205 def update_status(self, task_uuid: str, status: str, **kwargs):
206 """更新任务状态"""
207 if task_uuid not in _task_status:
208 _task_status[task_uuid] = {}
209
210 _task_status[task_uuid]["status"] = status
211 _task_status[task_uuid].update(kwargs)
212
213 # 与批量任务保持一致:状态变更后主动广播,避免前端只停留在初始 pending。
214 if self._loop and self._loop.is_running():
215 try:
216 asyncio.run_coroutine_threadsafe(
217 self.broadcast_status(task_uuid, status, **kwargs),
218 self._loop,
219 )
220 except Exception as e:
221 logger.warning(f"广播任务状态失败: {e}")
222
223 def get_status(self, task_uuid: str) -> Optional[dict]:
224 """获取任务状态"""

Callers 4

_mark_task_cancelledFunction · 0.45
run_registration_taskFunction · 0.45
run_batch_parallelFunction · 0.45

Calls 2

broadcast_statusMethod · 0.95
warningMethod · 0.80

Tested by

no test coverage detected