From 5a6639ba0450e5f58955f5d7d906b9e454a4295e Mon Sep 17 00:00:00 2001
From: panlei <2799247126@qq.com>
Date: 星期一, 04 十一月 2019 17:08:11 +0800
Subject: [PATCH] 关闭推送看cpu占用

---
 insertdata/insertDataToEs.go |   28 +++++++++-------------------
 1 files changed, 9 insertions(+), 19 deletions(-)

diff --git a/insertdata/insertDataToEs.go b/insertdata/insertDataToEs.go
index 25200e0..b5f88c7 100644
--- a/insertdata/insertDataToEs.go
+++ b/insertdata/insertDataToEs.go
@@ -165,20 +165,7 @@
 	videoPersonUrl = "http://" + localConfig1.AlarmIp + ":" + strconv.Itoa(int(localConfig1.AlarmPort)) + "/" + EsInfo.EsIndex.VideoPersons.IndexName + "/" + EsInfo.EsIndex.VideoPersons.IndexType
 	personAction = "http://" + localConfig1.AlarmIp + ":" + strconv.Itoa(int(localConfig1.AlarmPort)) + "/" + EsInfo.EsIndex.Personaction.IndexName + "/" + EsInfo.EsIndex.Personaction.IndexType
 	InsertFace(msg, "")
-	// 濡傛灉鏍囩涓惈鏈夋寔缁椂闂撮娆℃姤璀︾殑timeLabel鐨勮瘽鍒欎笉闇�瑕佽繃浜轰綋杩借釜锛屼笉鐒跺氨娌$殑鎻掑叆浜�
-	fk := ruleserver.TrackOrNot(msg.RuleResult)
-	if fk {
-		InsertYolo(msg, "")
-		//if msg.Cid == "61de081a-7ed9-4970-8432-41d642c35456" {
-		//	logger.Warn("鎹曟崏188鎽勫儚鏈虹殑鎸佺画鏃堕棿浠诲姟.....")
-		//	os.Exit(1)
-		//}
-	} else {
-		flag := ruleserver.BodyIsSame(msg.SdkMessage)
-		if !flag {
-			InsertYolo(msg, "")
-		}
-	}
+	InsertYolo(msg, "")
 }
 
 // 寰�es涓彃鍏ヤ汉鑴告暟鎹�
@@ -207,6 +194,13 @@
 				}
 				i := protomsg.Image{}
 				err = proto.Unmarshal(bdata, &i)
+				// 鍏堜紶灏忓浘锛屽啀浼犲ぇ鍥撅紝闃叉鑴镐笂鏈夌嚎
+				bytes := util.SubImg(i, int(face.Location.X), int(face.Location.Y), int(face.Location.X+face.Location.Width), int(face.Location.Y+face.Location.Height))
+				resp, err := util.PostFormBufferData1(weedfsUrl, bytes, uuid.NewV4().String())
+				if err != nil {
+					logger.Error("涓婁紶灏忓浘鍑洪敊")
+				}
+				// 涓婁紶澶у浘
 				if imgMaxUrl == "" {
 					bigPhotoUrl := make(map[string]interface{})
 					bigPhotoUrl, err = util.DrawPolygonOnImageForFace(msg.Cid, i, msg.RuleResult["face"].([]structure.FaceResult), weedfsUrl)
@@ -225,11 +219,7 @@
 				if err != nil {
 					logger.Error("鏌ヨ鎽勫儚鏈轰俊鎭け璐�")
 				}
-				bytes := util.SubImg(i, int(face.Location.X), int(face.Location.Y), int(face.Location.X+face.Location.Width), int(face.Location.Y+face.Location.Height))
-				resp, err := util.PostFormBufferData1(weedfsUrl, bytes, uuid.NewV4().String())
-				if err != nil {
-					logger.Error("涓婁紶灏忓浘鍑洪敊")
-				}
+
 				//logger.Info("================灏忓浘鍦板潃:", resp["fileUrl"].(string))
 				sex := ""
 				logger.Info(sex)

--
Gitblit v1.8.0