fix: 停止后不再多发心跳,换课按知识编号重置
This commit is contained in:
@@ -166,7 +166,7 @@ def settle(account, live: dict | None = None, now: datetime | None = None) -> bo
|
||||
|
||||
|
||||
def payload_for(employee_id: str) -> dict:
|
||||
from euniv.autostudy import autostudy_status
|
||||
from euniv.autostudy import account_status
|
||||
from euniv.db import SessionLocal
|
||||
from euniv.models import Account
|
||||
|
||||
@@ -186,8 +186,7 @@ def payload_for(employee_id: str) -> dict:
|
||||
account = db.get(Account, key)
|
||||
if account is None:
|
||||
return empty
|
||||
status = autostudy_status()
|
||||
live = dict((status.get("users") or {}).get(key) or {})
|
||||
live = account_status(key)
|
||||
if settle(account, live):
|
||||
db.commit()
|
||||
return stamp_frame(key, assemble(account, live))
|
||||
|
||||
Reference in New Issue
Block a user