mirror of
https://github.com/linux-do/new-api.git
synced 2025-11-09 23:53:41 +08:00
feat: update cache #204
This commit is contained in:
@@ -410,6 +410,11 @@ func ValidateAccessToken(token string) (user *User) {
|
||||
|
||||
func GetUserQuota(id int) (quota int, err error) {
|
||||
err = DB.Model(&User{}).Where("id = ?", id).Select("quota").Find("a).Error
|
||||
if err != nil {
|
||||
if common.RedisEnabled {
|
||||
go CacheSetUserQuota(id, quota)
|
||||
}
|
||||
}
|
||||
return quota, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user