Commit 2d241e1c authored by jingbo.wang's avatar jingbo.wang

分表完成

parent d4eba168
......@@ -13,6 +13,7 @@ import (
var (
receiverList = make([]string, 0)
serviceOwner = make(map[string][]string)
)
func init() {
......@@ -24,6 +25,15 @@ func init() {
}
receiverList = rList
})
global.Config.Watch(global.NamespaceApplication, "service.owner", func(oldCfg string, newCfg string) {
obj := make(map[string][]string)
if err := json.Unmarshal([]byte(newCfg), &obj); err != nil {
glog.Error("can not unmarshal json:", err, " ", newCfg)
return
}
serviceOwner = obj
})
}
//保存服务报表的目录
......@@ -82,12 +92,14 @@ func run(now time.Time, dir string) {
glog.Error("报表写入文件失败:", fileName, err)
glog.Info(body)
}
//发送给服务负责人
//如果存在,则发送邮件
serviceOwnerEmailList, ok := serviceOwner[name]
if !ok {
continue
}
email.SendEmail(fileNamePrefix+"-服务健康状态表:"+name, body, serviceOwnerEmailList...)
}
}
//TODO
}
//日表
//TODO
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment