This commit is contained in:
parent
09ff2ed123
commit
5a81c570c0
@ -258,10 +258,10 @@ def supplement_decision_logs(session: Session) -> int:
|
||||
select(IntelligentEvalDecisionLogDB).where(IntelligentEvalDecisionLogDB.eval_id == ev.id)
|
||||
).all()
|
||||
}
|
||||
|
||||
|
||||
if ev.status == IntelligentEvalStatus.EXECUTING.value:
|
||||
added += _supplement_executing(ev, sessions, completed, estimated, types, session)
|
||||
elif ev.status == IntelligentEvalStatus.COMPLETED.value:
|
||||
added += _supplement_completed(ev, sessions, completed, estimated, plan, types, session)
|
||||
|
||||
|
||||
return added
|
||||
|
||||
@ -432,7 +432,7 @@ def expire_stale_running_sessions(session: Session) -> int:
|
||||
now = utc_now()
|
||||
# SQLite 读出为 naive datetime,阈值须同为 naive 才能在 Python 侧比较
|
||||
threshold = now.replace(tzinfo=None) - timedelta(minutes=SESSION_IDLE_EXPIRE_MINUTES)
|
||||
|
||||
|
||||
# 单次查询获取所有 running 会话及其最后消息时间(避免 N+1 查询)
|
||||
stmt = (
|
||||
select(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user