Files
syops/backend/app/jobs/store.py
T

21 lines
553 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""
backend/app/jobs/store.py
用途:Job 表 CRUD(claim、update status)。
逻辑:runner 通过 claim_next 获取待执行任务;Wave 2 落地 SQLAlchemy 模型。
"""
from __future__ import annotations
from typing import Any
def claim_next() -> dict[str, Any] | None:
"""
认领下一条待执行 Job(SELECT FOR UPDATE SKIP LOCKED)。
Returns:
job 字典或 None。
Raises:
NotImplementedError: Wave 0 占位。
"""
raise NotImplementedError('jobs.store.claim_next is not wired until Wave 2')