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

Function updateUserCache

model/user_cache.go:86–91  ·  view source on GitHub ↗

updateUserCache refreshes non-quota user cache fields. Quota is maintained by atomic quota delta paths and must not be overwritten by stale user snapshots from profile/settings updates.

(user User)

Source from the content-addressed store, hash-verified

84// Quota is maintained by atomic quota delta paths and must not be overwritten
85// by stale user snapshots from profile/settings updates.
86func updateUserCache(user User) error {
87 if !common.RedisEnabled {
88 return nil
89 }
90 return writeUserCache(user.ToBaseUser(), false)
91}
92
93// GetUserCache gets complete user cache from hash
94func GetUserCache(userId int) (*UserBase, error) {

Callers 5

PublishUserAuthCacheFunction · 0.85
BindEmailToUserFunction · 0.85
UpdateMethod · 0.85
EditMethod · 0.85
ClearBindingMethod · 0.85

Calls 2

writeUserCacheFunction · 0.85
ToBaseUserMethod · 0.80

Tested by

no test coverage detected