---
panlei
2019-11-05 395893f325dc9477754f33dc422c2a95f0edcc4f
main.go
@@ -13,16 +13,10 @@
   "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"
@@ -93,7 +87,7 @@
         } else {
            //runtime.GOMAXPROCS(runtime.NumCPU())
            //logger.Debug("使用的cpu个数:",runtime.NumCPU())
            //go func(msg []byte) {
            go func(msg []byte) {
               logger.Debug("当前时间戳:", time.Now().Unix())
               arg := structure.SdkDatas{}
               //paramFormat(msg, &arg)
@@ -103,13 +97,16 @@
               ruleserver.Judge(&arg, &m) // 把sdkMessage传进去,方便缓存数据时拼出一个resultMag
               // 把arg里的打的标签拿出来给m再封装一层
               resultMsg := structure.ResultMsg{SdkMessage: &m, RuleResult: arg.RuleResult}
               logger.Debug("规则判断完所用时间:", time.Since(start))
               ruleserver.GetAttachInfo(resultMsg.SdkMessage)
               ruleEnd := time.Since(start)
               logger.Debug("规则判断完所用时间:", ruleEnd)
               // 将打完标签的数据插入到ES
               insertdata.InsertToEs(resultMsg)
               logger.Debug("插入完Es所用时间:", time.Since(start))
               esEnd := time.Since(start)
               logger.Debug("插入完Es所用时间:", esEnd)
               //事件推送
               go labelFilter.PushSomthing(resultMsg)
            //}(msg)
               //labelFilter.PushSomthing(resultMsg)
            }(msg)
         }
      }
   }