aa
This commit is contained in:
@@ -234,7 +234,6 @@ func (t *TcpClient) doPrint(key string) (err error) {
|
||||
dao.UpdateEntity(db, printMsg, "Status", "Comment")
|
||||
if t.isExist(key) {
|
||||
t.clear(key)
|
||||
close(t.TimeoutMap[key])
|
||||
}
|
||||
return
|
||||
} else {
|
||||
@@ -244,8 +243,8 @@ func (t *TcpClient) doPrint(key string) (err error) {
|
||||
//t.delConn(printMsg.PrintNo)
|
||||
if t.isExist(key) {
|
||||
t.clear(key)
|
||||
close(t.TimeoutMap[key])
|
||||
}
|
||||
return
|
||||
} else {
|
||||
globals.SugarLogger.Debugf("handleTcpMessages success, data: %v", hex.EncodeToString(data))
|
||||
//等待回调
|
||||
@@ -278,9 +277,8 @@ func (t *TcpClient) HandleCheckTcpHeart(key string) {
|
||||
changePrinterStatus(key, printerStatusOffline)
|
||||
if t.isExist(key) {
|
||||
t.clear(key)
|
||||
close(t.TimeoutMap[key])
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -280,6 +280,8 @@ func (t *TcpClient) clear(key string) {
|
||||
delete(t.MsgMap, key)
|
||||
close(t.CallBackMap[key])
|
||||
delete(t.CallBackMap, key)
|
||||
close(t.TimeoutMap[key])
|
||||
delete(t.TimeoutMap, key)
|
||||
}
|
||||
|
||||
func NewTcpClient() *TcpClient {
|
||||
|
||||
Reference in New Issue
Block a user