diff --git a/business/jxstore/event/event_tcp.go b/business/jxstore/event/event_tcp.go index 1a78499b6..18308db01 100644 --- a/business/jxstore/event/event_tcp.go +++ b/business/jxstore/event/event_tcp.go @@ -75,7 +75,7 @@ func handleConn(c net.Conn) error { delete(PrintIpAndAddr, printNo) delete(PrintObject, printNo) delete(PrintAddrAndIp, printRemoteAddr) - dao.ExecuteSQL(dao.GetDB(), `UPDATE print SET status = -1,is_online = -1 WHERE print_no = ? `, []interface{}{printNo}...) + dao.ExecuteSQL(dao.GetDB(), `UPDATE printer SET status = -1,is_online = -1 WHERE print_no = ? `, []interface{}{printNo}...) } return err } @@ -97,7 +97,7 @@ func handleConn(c net.Conn) error { } t, ok := PrintObject[printNo] - if !ok { + if !ok || t.Clients[printNo] == nil || t.Clients[printNo].StatusTime.Second()-time.Now().Second() >= 120 { t = NewTcpClient() }