1
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user