MCPcopy Create free account
hub / github.com/QuantumNous/new-api / updateUserStatusCache

Function updateUserStatusCache

model/user_cache.go:209–218  ·  view source on GitHub ↗

New functions for individual field updates

(userId int, status bool)

Source from the content-addressed store, hash-verified

207
208// New functions for individual field updates
209func 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
220func updateUserQuotaCache(userId int, quota int) error {
221 if !common.RedisEnabled {

Callers 1

updateUserCacheFunction · 0.85

Calls 2

RedisHSetFieldFunction · 0.92
getUserCacheKeyFunction · 0.85

Tested by

no test coverage detected