← Về thư mục
openai4s/storage/workloads.py
- create_workload_schema · function · L88-L90 — def create_workload_schema(conn: sqlite3.Connection) -> None
- ActiveAllocationExists · class · L93-L99 — class ActiveAllocationExists(RuntimeError)
- _spec_to_json · function · L102-L120 — def _spec_to_json(spec: WorkloadSpec) -> str
- _spec_from_json · function · L123-L140 — def _spec_from_json(text: str) -> WorkloadSpec
- WorkloadRepository · class · L143-L666 — class WorkloadRepository
- init · method · L146-L155 — def init( self, connection: sqlite3.Connection, lock: Any, *, clock_ms: Callable[[], int], ) -> None
- create_workload · method · L159-L198 — def create_workload( self, *, spec: WorkloadSpec, owner_user_id: str, project_id: str | None = None, backend: str = "local", ) -> Workload
- create_session_workload · method · L200-L275 — def create_session_workload( self, *, session_id: str, spec: WorkloadSpec, owner_user_id: str, project_id: str | None, backend: str, idle_ttl_s: int, max_lifetime_s: int, ) -> Workload
- release_session_workload · method · L277-L343 — def release_session_workload( self, *, session_id: str, reason: Reason, expected_workload_id: str | None = None, ) -> str | None
- _row_to_workload · method · L345-L359 — def _row_to_workload(self, row: Any) -> Workload
- get_workload · method · L361-L366 — def get_workload(self, workload_id: str) -> Workload | None
- list_workloads · method · L368-L393 — def list_workloads( self, *, owner_user_id: str | None = None, project_id: str | None = None, include_terminal: bool = True, limit: int = 100, ) -> list[Workload]
- session_cleanup_candidates · method · L395-L425 — def session_cleanup_candidates(self) -> list[tuple[str, str, Reason | None]]
- workloads_needing_attention · method · L427-L435 — def workloads_needing_attention(self) -> list[Workload]
- save_workload · method · L437-L468 — def save_workload(self, workload: Workload) -> None
- save_allocation_and_workload · method · L470-L519 — def save_allocation_and_workload( self, allocation: Allocation, workload: Workload ) -> None
- open_recovery_epoch · method · L521-L523 — def open_recovery_epoch(self, allocation: Allocation, workload: Workload) -> None
- request_stop · method · L525-L541 — def request_stop(self, workload_id: str, *, reason: Reason) -> bool
- create_allocation · method · L545-L574 — def create_allocation(self, workload_id: str, epoch: int) -> Allocation
- _row_to_allocation · method · L576-L593 — def _row_to_allocation(self, row: Any) -> Allocation
- get_allocation · method · L595-L602 — def get_allocation(self, allocation_id: str) -> Allocation | None
- active_allocation · method · L604-L611 — def active_allocation(self, workload_id: str) -> Allocation | None
- session_registration_expected · method · L613-L638 — def session_registration_expected(self, allocation_id: str, epoch: int) -> bool
- list_allocations · method · L640-L646 — def list_allocations(self, workload_id: str) -> list[Allocation]
- save_allocation · method · L648-L666 — def save_allocation(self, allocation: Allocation) -> None