MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / updateUserCache

Function updateUserCache

model/user_cache.go:60–70  ·  view source on GitHub ↗

updateUserCache updates all user cache fields using hash

(user User)

Source from the content-addressed store, hash-verified

58
59// updateUserCache updates all user cache fields using hash
60func updateUserCache(user User) error {
61 if !common.RedisEnabled {
62 return nil
63 }
64
65 return common.RedisHSetObj(
66 getUserCacheKey(user.Id),
67 user.ToBaseUser(),
68 time.Duration(common.RedisKeyCacheSeconds())*time.Second,
69 )
70}
71
72// GetUserCache gets complete user cache from hash
73func GetUserCache(userId int) (userCache *UserBase, err error) {

Callers 3

GetUserCacheFunction · 0.85
UpdateMethod · 0.85
EditMethod · 0.85

Calls 4

RedisHSetObjFunction · 0.92
RedisKeyCacheSecondsFunction · 0.92
getUserCacheKeyFunction · 0.85
ToBaseUserMethod · 0.80

Tested by

no test coverage detected