config: Initialize notify for fresh configs. (#2531)

This commit is contained in:
Harshavardhana 2016-08-22 16:04:04 -07:00 committed by GitHub
parent 4722c94653
commit 9dd0e3dc44
1 changed files with 8 additions and 0 deletions

View File

@ -55,6 +55,14 @@ func initConfig() error {
Enable: true,
Level: "fatal",
}
// Make sure to initialize notification configs.
srvCfg.Notify.AMQP = make(map[string]amqpNotify)
srvCfg.Notify.AMQP["1"] = amqpNotify{}
srvCfg.Notify.ElasticSearch = make(map[string]elasticSearchNotify)
srvCfg.Notify.ElasticSearch["1"] = elasticSearchNotify{}
srvCfg.Notify.Redis = make(map[string]redisNotify)
srvCfg.Notify.Redis["1"] = redisNotify{}
srvCfg.rwMutex = &sync.RWMutex{}
// Create config path.