fix(log): preserve quota in usage statistics (#7108)

* fix(log): preserve quota in usage statistics
This commit is contained in:
jimmyleocn
2026-08-31 11:36:43 +08:00
committed by GitHub
parent 2b6f1dfefb
commit 8c8c4153d4
+7 -1
View File
@@ -678,10 +678,16 @@ func SumUsedQuota(logType int, startTimestamp int64, endTimestamp int64, modelNa
common.SysError("failed to query log stat: " + err.Error())
return stat, errors.New("查询统计数据失败")
}
if err := rpmTpmQuery.Scan(&stat).Error; err != nil {
var rateStat struct {
Rpm int
Tpm int
}
if err := rpmTpmQuery.Scan(&rateStat).Error; err != nil {
common.SysError("failed to query rpm/tpm stat: " + err.Error())
return stat, errors.New("查询统计数据失败")
}
stat.Rpm = rateStat.Rpm
stat.Tpm = rateStat.Tpm
return stat, nil
}