From e64bf1b85548b515b78cdf09b389493e80b1e1b1 Mon Sep 17 00:00:00 2001
From: panlei <2799247126@qq.com>
Date: 星期一, 04 十一月 2019 14:36:09 +0800
Subject: [PATCH] ---

---
 main.go |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/main.go b/main.go
index 591c1b0..d3ef9fd 100644
--- a/main.go
+++ b/main.go
@@ -12,12 +12,13 @@
 	"ruleprocess/util"
 	"time"
 
+	"basic.com/valib/logger.git"
 	//"bufio"
 	//"bytes"
 	"flag"
 	"fmt"
 	"github.com/golang/protobuf/proto"
-	"basic.com/valib/logger.git"
+	"github.com/spf13/viper"
 	//"gocv.io/x/gocv"
 	//"image"
 	//"image/color"
@@ -25,7 +26,6 @@
 	"ruleprocess/cache"
 	"ruleprocess/ruleserver"
 	"sync"
-	"github.com/spf13/viper"
 )
 
 var dbIp = flag.String("dbIp", "127.0.0.1", "dbserver ip")
@@ -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)
@@ -102,12 +103,16 @@
 					ruleserver.Judge(&arg, &m) // 鎶妔dkMessage浼犺繘鍘伙紝鏂逛究缂撳瓨鏁版嵁鏃舵嫾鍑轰竴涓猺esultMag
 					// 鎶奱rg閲岀殑鎵撶殑鏍囩鎷垮嚭鏉ョ粰m鍐嶅皝瑁呬竴灞�
 					resultMsg := structure.ResultMsg{SdkMessage: &m, RuleResult: arg.RuleResult}
-					logger.Debug("瑙勫垯鍒ゆ柇瀹屾墍鐢ㄦ椂闂达細", time.Since(start))
+					ruleEnd := time.Since(start)
+					logger.Debug("瑙勫垯鍒ゆ柇瀹屾墍鐢ㄦ椂闂达細", ruleEnd)
 					// 灏嗘墦瀹屾爣绛剧殑鏁版嵁鎻掑叆鍒癊S
 					insertdata.InsertToEs(resultMsg)
-					logger.Debug("鎻掑叆瀹孍s鎵�鐢ㄦ椂闂达細", time.Since(start))
+					esEnd := time.Since(start)
+					logger.Debug("鎻掑叆瀹孍s鎵�鐢ㄦ椂闂达細", esEnd)
 					//浜嬩欢鎺ㄩ��
-					go labelFilter.Judge(resultMsg)
+					labelFilter.PushSomthing(resultMsg)
+					//pushEnd := time.Since(start)
+					//logger.Info("浜嬩欢鎺ㄩ�佸畬鎵�鐢ㄦ椂闂达細",ruleEnd,esEnd,pushEnd)
 				//}(msg)
 			}
 		}

--
Gitblit v1.8.0