From 039dc1f29dfcb831e2033f2db9addc018b851695 Mon Sep 17 00:00:00 2001 From: panlei <2799247126@qq.com> Date: 星期一, 04 十一月 2019 10:09:56 +0800 Subject: [PATCH] 整体起协程 --- main.go | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 5fc3011..366becd 100644 --- a/main.go +++ b/main.go @@ -63,6 +63,7 @@ go cache.Init(initchan, *dbIp, *surveyPort, *pubPort) logger.Info("cache init completed!!!", <-initchan) //dbserver鍒濆鍖栧畬姣� ruleserver.Init() + labelFilter.Init() go ruleserver.TimeTicker() go ruleserver.StartServer() nReciever("ipc:///tmp/sdk-2-rules-process.ipc", deliver.PushPull, 1) @@ -92,7 +93,7 @@ } else { //runtime.GOMAXPROCS(runtime.NumCPU()) //logger.Debug("浣跨敤鐨刢pu涓暟锛�",runtime.NumCPU()) - //go func(msg []byte) { + go func(msg []byte) { logger.Debug("褰撳墠鏃堕棿鎴筹細", time.Now().Unix()) arg := structure.SdkDatas{} //paramFormat(msg, &arg) @@ -107,8 +108,8 @@ insertdata.InsertToEs(resultMsg) logger.Debug("鎻掑叆瀹孍s鎵�鐢ㄦ椂闂达細", time.Since(start)) //浜嬩欢鎺ㄩ�� - go labelFilter.Judge(resultMsg) - //}(msg) + labelFilter.PushSomthing(resultMsg) + }(msg) } } } -- Gitblit v1.8.0