Use database abstration in tilemapper, too.

This commit is contained in:
Sascha L. Teichmann 2022-03-01 13:59:41 +01:00
parent 68ce57aa75
commit 834c8a9bc6

View File

@ -6,12 +6,10 @@ package main
import ( import (
"flag" "flag"
"fmt"
"image" "image"
"log" "log"
"os" "os"
"runtime/pprof" "runtime/pprof"
"strings"
"bitbucket.org/s_l_teichmann/mtsatellite/common" "bitbucket.org/s_l_teichmann/mtsatellite/common"
) )
@ -85,17 +83,9 @@ func main() {
colors.TransparentDim = common.Clamp32f( colors.TransparentDim = common.Clamp32f(
float32(transparentDim/100.0), 0.0, 100.0) float32(transparentDim/100.0), 0.0, 100.0)
var proto, address string client, err := common.CreateDBClientCreator(host, port)()
if strings.ContainsRune(host, '/') { if err != nil {
proto, address = "unix", host log.Fatalf("Cannot connect to '%s:%d': %s", host, port, err)
} 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)
} }
defer client.Close() defer client.Close()