diff --git a/business/jxstore/event/event_tcp.go b/business/jxstore/event/event_tcp.go index c4d8b06c3..580f769ad 100644 --- a/business/jxstore/event/event_tcp.go +++ b/business/jxstore/event/event_tcp.go @@ -51,7 +51,6 @@ func ListenTcp() { t := NewTcpClient() if err := handleConn(c, t); err != nil { t = nil - //Poll.Stop() return } } @@ -76,7 +75,6 @@ func ListenTcp() { func handleConn(c net.Conn, t *TcpClient) error { if c == nil { - globals.SugarLogger.Debugf("conn is nil") return errors.New("conn is nil") } defer c.Close() @@ -131,7 +129,8 @@ func handleConn(c net.Conn, t *TcpClient) error { //t.printFail() } changePrinterStatus(printNo, status) - t.HandleCheckTcpHeart(printNo) + // 暂时关闭心跳检测 + //t.HandleCheckTcpHeart(printNo) // todo 证明打印机已经被激活,将激活打印机存入数据库,保证用户不能无限制绑定打印机 if err := dao.NotExistsCreate(printNo); err != nil { globals.SugarLogger.Debugf("监听打印机心跳,不存在则创建 :[%v],printNo[%s]", err, printNo) @@ -481,6 +480,7 @@ func (t *TcpClient) HandleCheckTcpHeart(key string) { if !utils.IsTimeZero(statusTime) { //1分钟内没心跳判断打印机掉线了 if time.Now().Sub(statusTime) > time.Minute+time.Second*10 { + globals.SugarLogger.Debugf("超过一分十秒没有心跳的打印机[%s]", key) changePrinterStatus(key, printerStatusOffline) delete(t.TimeoutMap, key) }