Browse Source

redis: support unix domain socket

master
yuriy0803 3 years ago
parent
commit
bbac418ae2
  1. 8
      storage/redis.go

8
storage/redis.go

@ -156,12 +156,16 @@ type Worker struct {
}
func NewRedisClient(cfg *Config, prefix string, pplns int64, CoinName string) *RedisClient {
client := redis.NewClient(&redis.Options{
options := redis.Options{
Addr: cfg.Endpoint,
Password: cfg.Password,
DB: cfg.Database,
PoolSize: cfg.PoolSize,
})
}
if cfg.Endpoint[0:1] == "/" {
options.Network = "unix"
}
client := redis.NewClient(&options)
return &RedisClient{client: client, prefix: prefix, pplns: pplns, CoinName: CoinName}
}

Loading…
Cancel
Save