mirror of
https://bitbucket.org/s_l_teichmann/mtsatellite
synced 2024-12-23 08:40:18 +01:00
Use database abstration in tilemapper, too.
This commit is contained in:
parent
68ce57aa75
commit
834c8a9bc6
@ -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()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user