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

Function cacheIncrUserQuota

model/user_cache.go:128–133  ·  view source on GitHub ↗

Add atomic quota operations using hash fields

(userId int, delta int64)

Source from the content-addressed store, hash-verified

126
127// Add atomic quota operations using hash fields
128func cacheIncrUserQuota(userId int, delta int64) error {
129 if !common.RedisEnabled {
130 return nil
131 }
132 return common.RedisHIncrBy(getUserCacheKey(userId), "Quota", delta)
133}
134
135func cacheDecrUserQuota(userId int, delta int64) error {
136 return cacheIncrUserQuota(userId, -delta)

Callers 2

cacheDecrUserQuotaFunction · 0.85
IncreaseUserQuotaFunction · 0.85

Calls 2

RedisHIncrByFunction · 0.92
getUserCacheKeyFunction · 0.85

Tested by

no test coverage detected