From 168266264d89a7e9f10401178937a7dd15e76de3 Mon Sep 17 00:00:00 2001
From: panlei <2799247126@qq.com>
Date: 星期四, 14 十一月 2019 11:52:56 +0800
Subject: [PATCH] 限制一下score等过滤条件走的次数

---
 main.go |   18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)

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

--
Gitblit v1.8.0