mirror of
https://github.com/linux-do/new-api.git
synced 2025-11-07 06:43:41 +08:00
fix: return quota to user when delete token (close #37)
This commit is contained in:
@@ -137,7 +137,7 @@ func relayHelper(c *gin.Context) error {
|
||||
ratio = common.RatioGPT3dot5
|
||||
}
|
||||
quota = int(float64(quota) * ratio)
|
||||
err := model.ConsumeTokenQuota(tokenId, quota)
|
||||
err := model.DecreaseTokenQuota(tokenId, quota)
|
||||
if err != nil {
|
||||
common.SysError("Error consuming token remain quota: " + err.Error())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user