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

Function cacheGetUserBase

model/user_cache.go:114–125  ·  view source on GitHub ↗
(userId int)

Source from the content-addressed store, hash-verified

112}
113
114func cacheGetUserBase(userId int) (*UserBase, error) {
115 if !common.RedisEnabled {
116 return nil, fmt.Errorf("redis is not enabled")
117 }
118 var userCache UserBase
119 // Try getting from Redis first
120 err := common.RedisHGetObj(getUserCacheKey(userId), &userCache)
121 if err != nil {
122 return nil, err
123 }
124 return &userCache, nil
125}
126
127// Add atomic quota operations using hash fields
128func cacheIncrUserQuota(userId int, delta int64) error {

Callers 1

GetUserCacheFunction · 0.85

Calls 2

RedisHGetObjFunction · 0.92
getUserCacheKeyFunction · 0.85

Tested by

no test coverage detected