diff --git a/business/jxstore/event/event_tcp.go b/business/jxstore/event/event_tcp.go index 4e910a797..93c66e361 100644 --- a/business/jxstore/event/event_tcp.go +++ b/business/jxstore/event/event_tcp.go @@ -48,7 +48,7 @@ type TcpClient struct { s *sync.RWMutex } -func init() { +func Init() { listenTcp() go handleTcpMessages() } diff --git a/main.go b/main.go index b4158a98c..6b722f448 100644 --- a/main.go +++ b/main.go @@ -3,6 +3,7 @@ package main import ( "flag" "fmt" + "git.rosy.net.cn/jx-callback/business/jxstore/event" "net/http" _ "net/http/pprof" "os" @@ -143,6 +144,9 @@ func main() { http.ListenAndServe("0.0.0.0:6060", nil) } }() + if globals.IsProductEnv() { + event.Init() + } beego.Run() } }