MCPcopy Create free account
hub / github.com/ModelTC/LightX2V / fail_task

Method fail_task

lightx2v/server/task_manager.py:127–140  ·  view source on GitHub ↗
(self, task_id: str, error: str, error_type: Optional[str] = None)

Source from the content-addressed store, hash-verified

125 if task.status == TaskStatus.CANCELLED:
126 return
127 task.status = TaskStatus.COMPLETED
128 task.end_time = datetime.now()
129 task.save_result_path = save_result_path
130 task.results = results or []
131 task.result_png = next((output.content for output in task.results if output.type == "image" and output.content is not None), None)
132 task.usage = usage
133
134 if task.result_png is not None:
135 self._evict_old_result_png_unlocked()
136
137 self.completed_tasks += 1
138 self._emit_queue_metrics_unlocked()
139
140 def fail_task(self, task_id: str, error: str, error_type: Optional[str] = None):
141 with self._lock:
142 if task_id not in self._tasks:
143 logger.warning(f"Task {task_id} not found for failure")

Callers 1

_process_single_taskMethod · 0.80

Calls 2

warningMethod · 0.80

Tested by

no test coverage detected