fix: remove dead code config.get experience
CI / lint (push) Successful in 6s
CI / test (push) Successful in 14s
CI / notify-on-failure (push) Successful in 1s
CI / lint (pull_request) Failing after 13m39s
CI / test (pull_request) Has been skipped
CI / notify-on-failure (pull_request) Failing after 14m58s
CI / lint (push) Successful in 6s
CI / test (push) Successful in 14s
CI / notify-on-failure (push) Successful in 1s
CI / lint (pull_request) Failing after 13m39s
CI / test (pull_request) Has been skipped
CI / notify-on-failure (pull_request) Failing after 14m58s
This commit is contained in:
@@ -15,7 +15,7 @@ from src.blackboard.queries import Queries
|
||||
from src.blackboard.db import VALID_STATUSES, OUTPUT_TYPES
|
||||
from src.blackboard.registry import ProjectRegistry
|
||||
|
||||
from src.utils import get_data_root
|
||||
import src.utils as _utils
|
||||
|
||||
router = APIRouter(prefix="/api/projects/{project_id}", tags=["blackboard"])
|
||||
|
||||
@@ -27,7 +27,7 @@ def _validate_project(project_id: str) -> str:
|
||||
"""校验 project_id,已知项目/虚拟项目放行,未知项目返回 400"""
|
||||
if project_id in _VIRTUAL_PROJECTS:
|
||||
return project_id
|
||||
reg = ProjectRegistry(get_data_root())
|
||||
reg = ProjectRegistry(_utils.get_data_root())
|
||||
if reg.get_project(project_id):
|
||||
return project_id
|
||||
raise HTTPException(400, {
|
||||
@@ -43,12 +43,12 @@ def _validate_project(project_id: str) -> str:
|
||||
|
||||
def _bb(project_id: str) -> Blackboard:
|
||||
_validate_project(project_id)
|
||||
return Blackboard(get_data_root() / project_id / "blackboard.db")
|
||||
return Blackboard(_utils.get_data_root() / project_id / "blackboard.db")
|
||||
|
||||
|
||||
def _q(project_id: str) -> Queries:
|
||||
_validate_project(project_id)
|
||||
return Queries(get_data_root() / project_id / "blackboard.db")
|
||||
return Queries(_utils.get_data_root() / project_id / "blackboard.db")
|
||||
|
||||
|
||||
# --- Tasks ---
|
||||
@@ -100,7 +100,7 @@ async def create_task(project_id: str, body: Dict[str, Any]):
|
||||
date_str = datetime.now().strftime('%Y%m%d')
|
||||
# seq: 查当前项目最大 seq
|
||||
import sqlite3
|
||||
db_path = get_data_root() / project_id / "blackboard.db"
|
||||
db_path = _utils.get_data_root() / project_id / "blackboard.db"
|
||||
try:
|
||||
conn = sqlite3.connect(str(db_path), timeout=5)
|
||||
max_id_row = conn.execute(
|
||||
|
||||
Reference in New Issue
Block a user