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 (
"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()