From 04b97019c85327af53e619a1dd971e3df4161968 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Wed, 26 Jul 2017 09:14:18 +0800 Subject: [PATCH] add init func for testing. Signed-off-by: Bo-Yi Wu --- gorush/notification_fcm_test.go | 2 ++ gorush/notification_test.go | 4 ---- gorush/status.go | 1 + 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/gorush/notification_fcm_test.go b/gorush/notification_fcm_test.go index 5b170ac..d2e1cb2 100644 --- a/gorush/notification_fcm_test.go +++ b/gorush/notification_fcm_test.go @@ -16,6 +16,8 @@ func init() { log.Fatal(err) } + InitWorkers(PushConf.Core.WorkerNum, PushConf.Core.QueueNum) + if err := InitAppStatus(); err != nil { log.Fatal(err) } diff --git a/gorush/notification_test.go b/gorush/notification_test.go index 461eb9b..fffd11d 100644 --- a/gorush/notification_test.go +++ b/gorush/notification_test.go @@ -8,10 +8,6 @@ import ( "github.com/stretchr/testify/assert" ) -func init() { - PushConf = config.BuildDefaultPushConf() - InitWorkers(PushConf.Core.WorkerNum, PushConf.Core.QueueNum) -} func TestCorrectConf(t *testing.T) { PushConf = config.BuildDefaultPushConf() diff --git a/gorush/status.go b/gorush/status.go index c198b79..82ef453 100644 --- a/gorush/status.go +++ b/gorush/status.go @@ -40,6 +40,7 @@ type IosStatus struct { // InitAppStatus for initialize app status func InitAppStatus() error { + LogAccess.Debug("Init App Status Engine as ", PushConf.Stat.Engine) switch PushConf.Stat.Engine { case "memory": StatStorage = memory.New()