This commit is contained in:
邹宗楠
2024-07-25 09:39:51 +08:00
parent 4ae054de73
commit 6cc389cd0f

View File

@@ -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()
}