Add atomic quota operations using hash fields
(userId int, delta int64)
| 126 | |
| 127 | // Add atomic quota operations using hash fields |
| 128 | func cacheIncrUserQuota(userId int, delta int64) error { |
| 129 | if !common.RedisEnabled { |
| 130 | return nil |
| 131 | } |
| 132 | return common.RedisHIncrBy(getUserCacheKey(userId), "Quota", delta) |
| 133 | } |
| 134 | |
| 135 | func cacheDecrUserQuota(userId int, delta int64) error { |
| 136 | return cacheIncrUserQuota(userId, -delta) |
no test coverage detected