← Về thư mục
openai4s/server/session_recovery.py
- kernel_idle_ttl · function · L21-L45 — def kernel_idle_ttl( environ: Mapping[str, str] | None = None, *, default: float = 0.0, ) -> float
- normalize · function · L31-L36 — def normalize(value: Any) -> float
- SessionRecoveryService · class · L48-L303 — class SessionRecoveryService
- init · method · L55-L101 — def init( self, *, store: Any, sessions: Callable[[], Iterable[Any]], turn_active: Callable[[str], bool], approval_pending: Callable[[str], bool], background_active: Callable[[Any], bool], release_idle: Callable[[Any, str], bool], background_last_activity_ms: Callable[[Any], int | None] | None = None, owner_instance_id: str = PROCESS_INSTANCE_ID, ttl_s: float | None = None, sweep_interval_s: float | None = None, clock: Callable[[], float] | None = None, ) -> None
- _default_interval · method · L104-L105 — def _default_interval(ttl_s: float) -> float
- reconcile_startup · method · L107-L163 — def reconcile_startup(self) -> int
- start · method · L165-L181 — def start(self) -> bool
- stop · method · L183-L193 — def stop(self, timeout: float = 5.0) -> None
- running · method · L198-L200 — def running(self) -> bool
- now_ms · method · L202-L203 — def now_ms(self) -> int
- touch · method · L205-L219 — def touch( self, session: Any, language: str | None = None, *, state: str | None = None, at_ms: int | None = None, ) -> int
- begin_recovery · method · L221-L225 — def begin_recovery(self, session: Any) -> None
- end_recovery · method · L227-L231 — def end_recovery(self, session: Any) -> None
- recovery_scope · method · L234-L239 — def recovery_scope(self, session: Any) -> Iterator[None]
- is_recovering · method · L241-L243 — def is_recovering(self, root_frame_id: str) -> bool
- blocked · method · L245-L252 — def blocked(self, session: Any) -> bool
- idle_expired · method · L254-L282 — def idle_expired(self, session: Any, *, now_ms: int | None = None) -> bool
- sweep_once · method · L284-L296 — def sweep_once(self) -> list[str]
- _run · method · L298-L303 — def _run(self) -> None