api.worker.run_store ==================== .. py:module:: api.worker.run_store .. autoapi-nested-parse:: What the worker keeps in Redis about scripts: their run history, their last snapshot, the stage each running script is at, and the per-record locks. Attributes ---------- .. autoapisummary:: api.worker.run_store.STAGE_TTL_SECONDS api.worker.run_store.LOCK_TTL_SECONDS api.worker.run_store.MAX_RUNS_PER_SCRIPT Classes ------- .. autoapisummary:: api.worker.run_store.RunStore Module Contents --------------- .. py:data:: STAGE_TTL_SECONDS :value: 3600 .. py:data:: LOCK_TTL_SECONDS :value: 600 .. py:data:: MAX_RUNS_PER_SCRIPT :value: 1000 .. py:class:: RunStore(client: redis.Redis[str]) .. py:attribute:: client .. py:method:: record(script: str, result: dict[str, Any]) -> None .. py:method:: recent(script: str, limit: int = 20, offset: int = 0) -> list[dict[str, Any]] .. py:method:: count(script: str) -> int .. py:method:: get_snapshot(script: str) -> dict[str, Any] | None .. py:method:: set_snapshot(script: str, snapshot: dict[str, Any]) -> None .. py:method:: set_stage(script: str, stage: str, record_id: str | None = None) -> None .. py:method:: get_stage(script: str, record_id: str | None = None) -> dict[str, Any] | None .. py:method:: clear_stage(script: str, record_id: str | None = None) -> None .. py:method:: get_all_stages(script: str) -> list[dict[str, Any]] The stage of every run of this script in progress (one per record), oldest first. .. py:method:: acquire_lock(script: str, record_id: str) -> bool False when the same script is already running for this record. .. py:method:: release_lock(script: str, record_id: str) -> None