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

Function cacheIncrTokenQuota

model/token_cache.go:29–36  ·  view source on GitHub ↗
(key string, increment int64)

Source from the content-addressed store, hash-verified

27}
28
29func cacheIncrTokenQuota(key string, increment int64) error {
30 key = common.GenerateHMAC(key)
31 err := common.RedisHIncrBy(fmt.Sprintf("token:%s", key), constant.TokenFiledRemainQuota, increment)
32 if err != nil {
33 return err
34 }
35 return nil
36}
37
38func cacheDecrTokenQuota(key string, decrement int64) error {
39 return cacheIncrTokenQuota(key, -decrement)

Callers 2

IncreaseTokenQuotaFunction · 0.85
cacheDecrTokenQuotaFunction · 0.85

Calls 2

GenerateHMACFunction · 0.92
RedisHIncrByFunction · 0.92

Tested by

no test coverage detected