fix: when cached quota is too low, force refresh it

This commit is contained in:
JustSong
2024-03-13 19:38:44 +08:00
parent 0710f8cd66
commit a72e5fcc9e
5 changed files with 21 additions and 15 deletions

View File

@@ -161,7 +161,7 @@ func PostConsumeQuota(ctx context.Context, tokenId int, quotaDelta int, totalQuo
if err != nil {
logger.SysError("error consuming token remain quota: " + err.Error())
}
err = model.CacheUpdateUserQuota(userId)
err = model.CacheUpdateUserQuota(ctx, userId)
if err != nil {
logger.SysError("error update user quota cache: " + err.Error())
}