This commit is contained in:
suyl
2021-08-02 15:56:04 +08:00
parent 63b9692adb
commit 90d441d02f
2 changed files with 11 additions and 0 deletions

View File

@@ -82,6 +82,8 @@ func (t *TcpClient) handleConn(c net.Conn) {
}
changePrinterStatus(printNo, status)
t.HandleCheckTcpHeart(printNo)
} else {
t.setPrintStatusTime(printNo)
}
if t.getPrintStatus(printNo) != status {
t.setPrintStatus(printNo, status)

View File

@@ -229,6 +229,15 @@ func (t *TcpClient) setPrintStatus(key string, status int) {
defer t.Unlock()
if t.Clients[key] != nil {
t.Clients[key].Status = status
//t.Clients[key].StatusTime = time.Now()
}
}
func (t *TcpClient) setPrintStatusTime(key string) {
t.Lock()
defer t.Unlock()
if t.Clients[key] != nil {
//t.Clients[key].Status = status
t.Clients[key].StatusTime = time.Now()
}
}