1
This commit is contained in:
@@ -97,7 +97,7 @@ func (t *TcpClient) handleConn(c net.Conn) {
|
||||
}
|
||||
} else {
|
||||
//在加到连接池中已经更新了时间,所以放在else里
|
||||
t.setPrintStatusTime(c, status, printNo)
|
||||
t.setPrintStatusTime(printNo)
|
||||
}
|
||||
//状态不一致再更新状态(可能缺纸了,过热了等)
|
||||
if t.getPrintStatus(printNo) != status {
|
||||
|
||||
@@ -255,14 +255,12 @@ func (t *TcpClient) setPrintStatus(key string, status int) {
|
||||
}
|
||||
}
|
||||
|
||||
func (t *TcpClient) setPrintStatusTime(c net.Conn, status int, key string) {
|
||||
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()
|
||||
t.Clients[key].C = c
|
||||
t.Clients[key].Status = status
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user