fix: 清掉清单里剩下的死代码、重复样式和评论解析

This commit is contained in:
2026-11-16 15:36:28 +08:00
parent 33640f7da8
commit 1cd7c7f818
12 changed files with 57 additions and 109 deletions
+9 -13
View File
@@ -124,27 +124,23 @@ def load_admin_identity() -> None:
identity.replace(row.admin_username, row.admin_password_cipher)
def refresh_interval_seconds(db: Session | None = None) -> int:
if db is None:
from euniv.db import SessionLocal
def refresh_interval_seconds() -> int:
from euniv.db import SessionLocal
with SessionLocal() as owned:
return int(load_config(owned).refresh_interval_minutes) * 60
return int(load_config(db).refresh_interval_minutes) * 60
with SessionLocal() as owned:
return int(load_config(owned).refresh_interval_minutes) * 60
def auto_attempt_count(db: Session) -> int:
return int(load_config(db).auto_jigsaw_attempts)
def heartbeat_intervals(db: Session | None = None) -> dict:
def heartbeat_intervals() -> dict:
"""返回 {mode, video, document, scorm}。mode 为 'auto' 时三个值仅作备用。"""
if db is None:
from euniv.db import SessionLocal
with SessionLocal() as owned:
row = load_config(owned)
else:
row = load_config(db)
from euniv.db import SessionLocal
with SessionLocal() as owned:
row = load_config(owned)
return {
"mode": row.heartbeat_interval_mode or "manual",
"video": int(row.heartbeat_video_seconds),