fix: 清掉清单里剩下的死代码、重复样式和评论解析
This commit is contained in:
@@ -46,9 +46,5 @@ class AdminIdentity:
|
||||
with self._lock:
|
||||
return self._username
|
||||
|
||||
def password_cipher(self) -> str:
|
||||
with self._lock:
|
||||
return self._password_cipher
|
||||
|
||||
|
||||
identity = AdminIdentity()
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user