add init func for testing.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2017-07-26 09:14:18 +08:00
parent 510265bb5b
commit 04b97019c8
3 changed files with 3 additions and 4 deletions

View File

@ -16,6 +16,8 @@ func init() {
log.Fatal(err) log.Fatal(err)
} }
InitWorkers(PushConf.Core.WorkerNum, PushConf.Core.QueueNum)
if err := InitAppStatus(); err != nil { if err := InitAppStatus(); err != nil {
log.Fatal(err) log.Fatal(err)
} }

View File

@ -8,10 +8,6 @@ import (
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )
func init() {
PushConf = config.BuildDefaultPushConf()
InitWorkers(PushConf.Core.WorkerNum, PushConf.Core.QueueNum)
}
func TestCorrectConf(t *testing.T) { func TestCorrectConf(t *testing.T) {
PushConf = config.BuildDefaultPushConf() PushConf = config.BuildDefaultPushConf()

View File

@ -40,6 +40,7 @@ type IosStatus struct {
// InitAppStatus for initialize app status // InitAppStatus for initialize app status
func InitAppStatus() error { func InitAppStatus() error {
LogAccess.Debug("Init App Status Engine as ", PushConf.Stat.Engine)
switch PushConf.Stat.Engine { switch PushConf.Stat.Engine {
case "memory": case "memory":
StatStorage = memory.New() StatStorage = memory.New()