chore: fix warnings (#3989)
This commit is contained in:
2
core/stores/cache/cacheopt.go
vendored
2
core/stores/cache/cacheopt.go
vendored
@@ -8,7 +8,7 @@ const (
|
||||
)
|
||||
|
||||
type (
|
||||
// An Options is used to store the cache options.
|
||||
// Options is used to store the cache options.
|
||||
Options struct {
|
||||
Expiry time.Duration
|
||||
NotFoundExpiry time.Duration
|
||||
|
||||
@@ -47,7 +47,7 @@ func (rc RedisConf) NewRedis() *Redis {
|
||||
opts = append(opts, WithTLS())
|
||||
}
|
||||
|
||||
return New(rc.Host, opts...)
|
||||
return newRedis(rc.Host, opts...)
|
||||
}
|
||||
|
||||
// Validate validates the RedisConf.
|
||||
|
||||
@@ -2,6 +2,7 @@ package redis
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"math/rand"
|
||||
"strconv"
|
||||
"sync/atomic"
|
||||
@@ -64,7 +65,7 @@ func (rl *RedisLock) AcquireCtx(ctx context.Context) (bool, error) {
|
||||
resp, err := rl.store.ScriptRunCtx(ctx, lockScript, []string{rl.key}, []string{
|
||||
rl.id, strconv.Itoa(int(seconds)*millisPerSecond + tolerance),
|
||||
})
|
||||
if err == red.Nil {
|
||||
if errors.Is(err, red.Nil) {
|
||||
return false, nil
|
||||
} else if err != nil {
|
||||
logx.Errorf("Error on acquiring lock for %s, %s", rl.key, err.Error())
|
||||
|
||||
Reference in New Issue
Block a user