refactor(backend): 后端重构初步设想

This commit is contained in:
sophie committed 2026-06-17 11:24:54 +08:00
1 parent b69d549b2c
commit 21b8c24815
96 files changed
+1592

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
"""
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')