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

Function invalidateUserCache

model/user_cache.go:53–58  ·  view source on GitHub ↗

invalidateUserCache clears user cache

(userId int)

Source from the content-addressed store, hash-verified

51
52// invalidateUserCache clears user cache
53func invalidateUserCache(userId int) error {
54 if !common.RedisEnabled {
55 return nil
56 }
57 return common.RedisDelKey(getUserCacheKey(userId))
58}
59
60// InvalidateUserCache is the exported version of invalidateUserCache.
61// 供 controller 等上层包在用户状态变更(如禁用、删除、角色变更)后主动清理缓存。

Callers 2

InvalidateUserCacheFunction · 0.85
DeleteMethod · 0.85

Calls 2

RedisDelKeyFunction · 0.92
getUserCacheKeyFunction · 0.85

Tested by

no test coverage detected