From 6cc389cd0fe5a1a3563f2521a913375ab106dd91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E5=AE=97=E6=A5=A0?= Date: Thu, 25 Jul 2024 09:39:51 +0800 Subject: [PATCH] 1 --- business/jxstore/event/event_tcp.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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() }