Skip to content

Commit

Permalink
fix Redis connection over Unix socket (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
tie authored Sep 8, 2023
1 parent 419142b commit 1d2f4d2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions redis_shard.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ func NewRedisShard(_ *Node, conf RedisShardConfig) (*RedisShard, error) {
} else if len(conf.ClusterAddresses) > 0 {
options.InitAddress = conf.ClusterAddresses
} else {
if conf.network == "unix" {
options.DialFn = func(s string, d *net.Dialer, c *tls.Config) (net.Conn, error) {
return d.Dial("unix", s)
}
}
options.InitAddress = []string{conf.address}
}

Expand Down

0 comments on commit 1d2f4d2

Please sign in to comment.