mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-18 01:26:37 +08:00
chore: update token.go to record consumption log
This commit is contained in:
parent
1c2e8f046b
commit
a8cc96bf4a
@ -294,7 +294,11 @@ func UpdateToken(c *gin.Context) {
|
||||
|
||||
cleanToken.UsedQuota += int64(tokenPatch.AddUsedQuota)
|
||||
cleanToken.RemainQuota -= int64(tokenPatch.AddUsedQuota)
|
||||
model.RecordLog(userId, model.LogTypeConsume, fmt.Sprintf("外部(%s)消耗 %s", tokenPatch.AddReason, common.LogQuota(int64(tokenPatch.AddUsedQuota))))
|
||||
model.RecordConsumeLog(c.Request.Context(),
|
||||
userId, 0, 0, 0, tokenPatch.AddReason, cleanToken.Name,
|
||||
int64(tokenPatch.AddUsedQuota),
|
||||
fmt.Sprintf("外部(%s)消耗 %s",
|
||||
tokenPatch.AddReason, common.LogQuota(int64(tokenPatch.AddUsedQuota))))
|
||||
default:
|
||||
// If you add more fields, please also update token.Update()
|
||||
cleanToken.Name = token.Name
|
||||
|
Loading…
Reference in New Issue
Block a user