mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-04 06:54:45 +08:00
新增hash值自增
This commit is contained in:
@@ -1416,3 +1416,22 @@ func (slf *RedisModule) ListPop(key string, fromLeft, block bool, timeout int) (
|
||||
}
|
||||
return b, nil
|
||||
}
|
||||
|
||||
|
||||
func (slf *RedisModule) HincrbyHashInt(redisKey, hashKey string, value int) error {
|
||||
if redisKey == "" || hashKey == "" {
|
||||
return errors.New("Key Is Empty")
|
||||
}
|
||||
conn, err := slf.getConn()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer conn.Close()
|
||||
|
||||
_, retErr := conn.Do("HINCRBY", redisKey, hashKey, value)
|
||||
if retErr != nil {
|
||||
service.GetLogger().Printf(service.LEVER_ERROR, "HincrbyHashInt fail,reason:%v", retErr)
|
||||
}
|
||||
|
||||
return retErr
|
||||
}
|
||||
Reference in New Issue
Block a user