Merge pull request #722 from bestgopher/optimization

一点小优化
This commit is contained in:
Marvin Zhang
2020-05-08 15:35:08 +08:00
committed by GitHub

View File

@@ -107,7 +107,7 @@ func (r *Redis) HKeys(collection string) ([]string, error) {
c := r.pool.Get()
defer utils.Close(c)
value, err2 := redis.Strings(c.Do("HKeys", collection))
value, err2 := redis.Strings(c.Do("HKEYS", collection))
if err2 != nil {
log.Error(err2.Error())
debug.PrintStack()
@@ -208,7 +208,7 @@ func (r *Redis) Lock(lockKey string) (int64, error) {
debug.PrintStack()
return 0, err
}
if err == nil && ok == nil {
if ok == nil {
log.Errorf("the lockKey is locked: key=%s", lockKey)
return 0, errors.New("the lockKey is locked")
}