refactor: 全部代码格式化
This commit is contained in:
@@ -46,17 +46,15 @@ class LLMStatistics:
|
||||
"""记录在线时间"""
|
||||
current_time = datetime.now()
|
||||
# 检查5分钟内是否已有记录
|
||||
recent_record = db.online_time.find_one({
|
||||
"timestamp": {
|
||||
"$gte": current_time - timedelta(minutes=5)
|
||||
}
|
||||
})
|
||||
|
||||
recent_record = db.online_time.find_one({"timestamp": {"$gte": current_time - timedelta(minutes=5)}})
|
||||
|
||||
if not recent_record:
|
||||
db.online_time.insert_one({
|
||||
"timestamp": current_time,
|
||||
"duration": 5 # 5分钟
|
||||
})
|
||||
db.online_time.insert_one(
|
||||
{
|
||||
"timestamp": current_time,
|
||||
"duration": 5, # 5分钟
|
||||
}
|
||||
)
|
||||
|
||||
def _collect_statistics_for_period(self, start_time: datetime) -> Dict[str, Any]:
|
||||
"""收集指定时间段的LLM请求统计数据
|
||||
|
||||
Reference in New Issue
Block a user