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

Function updateUserCache

model/user_cache.go:80–85  ·  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

78// Quota is maintained by atomic quota delta paths and must not be overwritten
79// by stale user snapshots from profile/settings updates.
80func updateUserCache(user User) error {
81 if !common.RedisEnabled {
82 return nil
83 }
84 return writeUserCache(user.ToBaseUser(), false)
85}
86
87// GetUserCache gets complete user cache from hash
88func 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