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

Method __init__

lightx2v/server/task_manager.py:55–71  ·  view source on GitHub ↗
(self, max_queue_size: int = 100, result_png_keep_count: Optional[int] = None)

Source from the content-addressed store, hash-verified

53 usage: Usage | dict | None = None
54 stop_event: threading.Event = field(default_factory=threading.Event)
55 thread: Optional[threading.Thread] = None
56
57
58class TaskManager:
59 def __init__(self, max_queue_size: int = 100, result_png_keep_count: Optional[int] = None):
60 self.max_queue_size = max_queue_size
61 if result_png_keep_count is None:
62 result_png_keep_count = _env_positive_int("LIGHTX2V_RESULT_PNG_KEEP_COUNT", 50)
63 self.result_png_keep_count = result_png_keep_count
64
65 self._tasks: OrderedDict[str, TaskInfo] = OrderedDict()
66 self._lock = threading.RLock()
67 self._task_available = threading.Condition(self._lock)
68
69 self._processing_lock = threading.Lock()
70 self._current_processing_task: Optional[str] = None
71
72 self.total_tasks = 0
73 self.completed_tasks = 0
74 self.failed_tasks = 0

Callers

nothing calls this directly

Calls 2

_env_positive_intFunction · 0.85

Tested by

no test coverage detected