mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-10-15 15:30:26 +00:00
fix: make quota int64
This commit is contained in:
@@ -178,7 +178,7 @@ func UpdateChannelStatusById(id int, status int) {
|
||||
}
|
||||
}
|
||||
|
||||
func UpdateChannelUsedQuota(id int, quota int) {
|
||||
func UpdateChannelUsedQuota(id int, quota int64) {
|
||||
if config.BatchUpdateEnabled {
|
||||
addNewRecord(BatchUpdateTypeChannelUsedQuota, id, quota)
|
||||
return
|
||||
@@ -186,7 +186,7 @@ func UpdateChannelUsedQuota(id int, quota int) {
|
||||
updateChannelUsedQuota(id, quota)
|
||||
}
|
||||
|
||||
func updateChannelUsedQuota(id int, quota int) {
|
||||
func updateChannelUsedQuota(id int, quota int64) {
|
||||
err := DB.Model(&Channel{}).Where("id = ?", id).Update("used_quota", gorm.Expr("used_quota + ?", quota)).Error
|
||||
if err != nil {
|
||||
logger.SysError("failed to update channel used quota: " + err.Error())
|
||||
|
Reference in New Issue
Block a user