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

Function invalidateUserCache

model/user_cache.go:63–68  ·  view source on GitHub ↗

invalidateUserCache clears user cache

(userId int)

Source from the content-addressed store, hash-verified

61
62// invalidateUserCache clears user cache
63func invalidateUserCache(userId int) error {
64 if !common.RedisEnabled {
65 return nil
66 }
67 return common.RedisDelKey(getUserCacheKey(userId))
68}
69
70// InvalidateUserCache is the exported version of invalidateUserCache.
71// 供 controller 等上层包在用户状态变更(如禁用、删除、角色变更)后主动清理缓存。

Callers 3

InvalidateUserCacheFunction · 0.85
DeleteMethod · 0.85
HardDeleteMethod · 0.85

Calls 2

RedisDelKeyFunction · 0.92
getUserCacheKeyFunction · 0.85

Tested by

no test coverage detected