Support unix domain sockets.

This commit is contained in:
Sascha L. Teichmann
2017-03-05 14:03:02 +01:00
parent 349906c622
commit ba2dd15280
2 changed files with 19 additions and 2 deletions

View File

@ -10,6 +10,7 @@ import (
"os"
"path/filepath"
"strconv"
"strings"
"sync"
"bitbucket.org/s_l_teichmann/mtsatellite/common"
@ -59,9 +60,17 @@ func createBaseLevel(
jobs := make(chan blockPos)
var done sync.WaitGroup
var proto string
if strings.ContainsRune(address, '/') {
proto = "unix"
} else {
proto = "tcp"
}
for i := 0; i < numWorkers; i++ {
var client *common.RedisClient
if client, err = common.NewRedisClient("tcp", address); err != nil {
if client, err = common.NewRedisClient(proto, address); err != nil {
return
}
done.Add(1)