MCPcopy
hub / github.com/QuantumNous/new-api / updateUserStatusCache

Function updateUserStatusCache

model/user_cache.go:188–197  ·  view source on GitHub ↗

New functions for individual field updates

(userId int, status bool)

Source from the content-addressed store, hash-verified

186
187// New functions for individual field updates
188func updateUserStatusCache(userId int, status bool) error {
189 if !common.RedisEnabled {
190 return nil
191 }
192 statusInt := common.UserStatusEnabled
193 if !status {
194 statusInt = common.UserStatusDisabled
195 }
196 return common.RedisHSetField(getUserCacheKey(userId), "Status", fmt.Sprintf("%d", statusInt))
197}
198
199func updateUserQuotaCache(userId int, quota int) error {
200 if !common.RedisEnabled {

Callers

nothing calls this directly

Calls 2

RedisHSetFieldFunction · 0.92
getUserCacheKeyFunction · 0.85

Tested by

no test coverage detected