From 1b4423e12c21dd2de7454205ac09f2e5a440a4a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorben=20G=C3=BCnther?= Date: Sun, 15 Dec 2019 22:59:13 +0100 Subject: [PATCH] Allow users to set redis port too. --- gitsrht-keys/main.go | 3 +-- gitsrht-update-hook/post-update.go | 3 +-- gitsrht-update-hook/update.go | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/gitsrht-keys/main.go b/gitsrht-keys/main.go index 410cec2..93a3419 100644 --- a/gitsrht-keys/main.go +++ b/gitsrht-keys/main.go @@ -150,9 +150,8 @@ func main() { redisHost, ok := config.Get("sr.ht", "redis-host") if !ok { - redisHost = "localhost" + redisHost = "localhost:6379" } - redisHost += ":6379" redis := goredis.NewClient(&goredis.Options{Addr: redisHost}) logf, err := os.OpenFile("/var/log/gitsrht-keys", diff --git a/gitsrht-update-hook/post-update.go b/gitsrht-update-hook/post-update.go index ae588f7..f921188 100644 --- a/gitsrht-update-hook/post-update.go +++ b/gitsrht-update-hook/post-update.go @@ -162,9 +162,8 @@ func postUpdate() { redisHost, ok := config.Get("sr.ht", "redis-host") if !ok { - redisHost = "localhost" + redisHost = "localhost:6379" } - redisHost += ":6379" redis := goredis.NewClient(&goredis.Options{Addr: redisHost}) for i, refname := range refs { var oldref, newref string diff --git a/gitsrht-update-hook/update.go b/gitsrht-update-hook/update.go index 93ef540..31a986e 100644 --- a/gitsrht-update-hook/update.go +++ b/gitsrht-update-hook/update.go @@ -24,9 +24,8 @@ func update() { redisHost, ok := config.Get("sr.ht", "redis-host") if !ok { - redisHost = "localhost" + redisHost = "localhost:6379" } - redisHost += ":6379" redis := goredis.NewClient(&goredis.Options{Addr: redisHost}) redis.Set(fmt.Sprintf("update.%s.%s", pushUuid, refname), fmt.Sprintf("%s:%s", oldref, newref), 10*time.Minute) -- 2.38.4