21 lines
553 B
Python
21 lines
553 B
Python
"""
|
||
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')
|