From 276cb49ae476af40677e2d1afcbe6e36b1ab3b38 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Wed, 7 Jun 2017 06:09:21 -0500 Subject: [PATCH] add redis addr flag. (#236) Signed-off-by: Bo-Yi Wu --- main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.go b/main.go index 3897aa9..8dcd7ed 100644 --- a/main.go +++ b/main.go @@ -44,6 +44,7 @@ Server Options: --title Notification title --proxy <proxy> Proxy URL (only for GCM) --pid <pid path> Process identifier path + --redis-addr <redis addr> Redis addr (default: localhost:6379) iOS Options: -i, --key <file> certificate key file path -P, --password <password> certificate key password @@ -119,6 +120,7 @@ func main() { flag.StringVar(&token, "token", "", "token string") flag.StringVar(&opts.Stat.Engine, "e", "", "store engine") flag.StringVar(&opts.Stat.Engine, "engine", "", "store engine") + flag.StringVar(&opts.Stat.Redis.Addr, "redis-addr", "", "redis addr") flag.StringVar(&message, "m", "", "notification message") flag.StringVar(&message, "message", "", "notification message") flag.StringVar(&title, "title", "", "notification title") @@ -175,6 +177,10 @@ func main() { gorush.PushConf.Stat.Engine = opts.Stat.Engine } + if opts.Stat.Redis.Addr != "" { + gorush.PushConf.Stat.Redis.Addr = opts.Stat.Redis.Addr + } + // overwrite server port if opts.Core.Port != "" { gorush.PushConf.Core.Port = opts.Core.Port