MCPcopy Create free account
hub / github.com/devfeel/dotweb / Decr

Method Decr

cache/redis/cache_redis.go:43–50  ·  view source on GitHub ↗

Decr decrease counter in redis cache.

(key string)

Source from the content-addressed store, hash-verified

41
42// Decr decrease counter in redis cache.
43func (ca *RedisCache) Decr(key string) (int64, error) {
44 redisClient := redisutil.GetDefaultRedisClient(ca.serverURL)
45 val, err := redisClient.DECR(key)
46 if err != nil {
47 return 0, err
48 }
49 return int64(val), nil
50}
51
52// Get cache from redis cache.
53// if non-existed or expired, return nil.

Callers

nothing calls this directly

Calls 1

DECRMethod · 0.80

Tested by

no test coverage detected