diff --git a/myredis/redis.go b/myredis/redis.go index f3c246c..dabca16 100644 --- a/myredis/redis.go +++ b/myredis/redis.go @@ -109,6 +109,7 @@ func New(config *Config) (*MyRedis, error) { MinIdleConns: config.MinIdleConn, MaxConnAge: maxConnAge, IdleTimeout: idleTimeout, + DialTimeout: time.Second * 2, }) ctx := context.Background()