diff --git a/storage/redis.go b/storage/redis.go index 8d761cf..b542871 100644 --- a/storage/redis.go +++ b/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} }