New functions for individual field updates
(userId int, status bool)
| 207 | |
| 208 | // New functions for individual field updates |
| 209 | func updateUserStatusCache(userId int, status bool) error { |
| 210 | if !common.RedisEnabled { |
| 211 | return nil |
| 212 | } |
| 213 | statusInt := common.UserStatusEnabled |
| 214 | if !status { |
| 215 | statusInt = common.UserStatusDisabled |
| 216 | } |
| 217 | return common.RedisHSetField(getUserCacheKey(userId), "Status", fmt.Sprintf("%d", statusInt)) |
| 218 | } |
| 219 | |
| 220 | func updateUserQuotaCache(userId int, quota int) error { |
| 221 | if !common.RedisEnabled { |
no test coverage detected