fix: return quota to user when delete token (close #37)

This commit is contained in:
JustSong
2023-05-04 10:20:39 +08:00
parent 4fed003f1a
commit 331177d97e
4 changed files with 24 additions and 8 deletions

View File

@@ -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())
}