diff --git a/cmd/mttilemapper/main.go b/cmd/mttilemapper/main.go index 55d6ffc..1801d7c 100644 --- a/cmd/mttilemapper/main.go +++ b/cmd/mttilemapper/main.go @@ -6,12 +6,10 @@ package main import ( "flag" - "fmt" "image" "log" "os" "runtime/pprof" - "strings" "bitbucket.org/s_l_teichmann/mtsatellite/common" ) @@ -85,17 +83,9 @@ func main() { colors.TransparentDim = common.Clamp32f( float32(transparentDim/100.0), 0.0, 100.0) - var proto, address string - if strings.ContainsRune(host, '/') { - proto, address = "unix", host - } else { - proto, address = "tcp", fmt.Sprintf("%s:%d", host, port) - } - - var client *common.RedisClient - - if client, err = common.NewRedisClient(proto, address); err != nil { - log.Fatalf("Cannot connect to '%s': %s", address, err) + client, err := common.CreateDBClientCreator(host, port)() + if err != nil { + log.Fatalf("Cannot connect to '%s:%d': %s", host, port, err) } defer client.Close()