From b84b451fc5d314565adbb7ead33955c3e5dafba5 Mon Sep 17 00:00:00 2001 From: panlei <2799247126@qq.com> Date: 星期四, 12 九月 2019 16:24:11 +0800 Subject: [PATCH] 加上事件推送 --- main.go | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 36470b8..411d714 100644 --- a/main.go +++ b/main.go @@ -4,7 +4,10 @@ "basic.com/dbapi.git" "basic.com/pubsub/protomsg.git" "basic.com/valib/deliver.git" + "net/http" + _ "net/http/pprof" "ruleprocess/insertdata" + "ruleprocess/labelFilter" "ruleprocess/util" "time" @@ -36,14 +39,17 @@ } func main() { + //fmt.Println("缂撳瓨鍒濆鍖栧畬鎴�",<- initchan)//dbserver鍒濆鍖栧畬姣� + go func() { + http.ListenAndServe("0.0.0.0:8899",nil) + }() flag.Parse() wg := sync.WaitGroup{} - wg.Add(2) + wg.Add(3) dbapi.Init(*dbIp, *dbPort) go cache.Init(initchan, *dbIp, *surveyPort, *pubPort) logger.Info("cache init completed!!!", <-initchan) //dbserver鍒濆鍖栧畬姣� - //fmt.Println("缂撳瓨鍒濆鍖栧畬鎴�",<- initchan)//dbserver鍒濆鍖栧畬姣� ruleserver.Init() go ruleserver.TimeTicker() go ruleserver.StartServer() @@ -89,7 +95,7 @@ insertdata.InsertToEs(resultMsg) logger.Debug("鎻掑叆瀹孍s鎵�鐢ㄦ椂闂达細", time.Since(start)) //浜嬩欢鎺ㄩ�� - //go labelFilter.Judge(resultMsg) + go labelFilter.Judge(resultMsg) //}(msg) } } -- Gitblit v1.8.0