panlei
2019-09-12 b84b451fc5d314565adbb7ead33955c3e5dafba5
main.go
@@ -4,7 +4,10 @@
   "basic.com/dbapi.git"
   "basic.com/pubsub/protomsg.git"
   "basic.com/valib/deliver.git"
   "net/http"
   _ "net/http/pprof"
   "ruleprocess/insertdata"
   "ruleprocess/labelFilter"
   "ruleprocess/util"
   "time"
@@ -36,14 +39,17 @@
}
func main() {
   //fmt.Println("缓存初始化完成",<- initchan)//dbserver初始化完毕
   go func() {
      http.ListenAndServe("0.0.0.0:8899",nil)
   }()
   flag.Parse()
   wg := sync.WaitGroup{}
   wg.Add(2)
   wg.Add(3)
   dbapi.Init(*dbIp, *dbPort)
   go cache.Init(initchan, *dbIp, *surveyPort, *pubPort)
   logger.Info("cache init completed!!!", <-initchan) //dbserver初始化完毕
   //fmt.Println("缓存初始化完成",<- initchan)//dbserver初始化完毕
   ruleserver.Init()
   go ruleserver.TimeTicker()
   go ruleserver.StartServer()
@@ -89,7 +95,7 @@
               insertdata.InsertToEs(resultMsg)
               logger.Debug("插入完Es所用时间:", time.Since(start))
               //事件推送
               //go labelFilter.Judge(resultMsg)
               go labelFilter.Judge(resultMsg)
            //}(msg)
         }
      }