This commit is contained in:
suyl
2021-08-03 11:04:58 +08:00
parent 9bbcfbe1dc
commit 55400e0b9e
2 changed files with 11 additions and 8 deletions

View File

@@ -167,7 +167,7 @@ func (t *TcpClient) HandleTcpMessages(printNo string) {
go func() {
for {
select {
case <-timeoutChan:
case <-t.TimeoutChan:
globals.SugarLogger.Debugf("HandleTcpMessages timeout")
return
default:
@@ -196,7 +196,7 @@ func (t *TcpClient) doPrint(key string) (err error) {
go func() {
for {
select {
case <-timeoutChan:
case <-t.TimeoutChan:
globals.SugarLogger.Debugf("doPrint timeout")
return
default:
@@ -233,7 +233,7 @@ func (t *TcpClient) doPrint(key string) (err error) {
dao.UpdateEntity(db, printMsg, "Status", "Comment")
if t.isExist(key) {
t.clear(key)
close(timeoutChan)
close(t.TimeoutChan)
}
return
} else {
@@ -243,7 +243,7 @@ func (t *TcpClient) doPrint(key string) (err error) {
//t.delConn(printMsg.PrintNo)
if t.isExist(key) {
t.clear(key)
close(timeoutChan)
close(t.TimeoutChan)
}
} else {
globals.SugarLogger.Debugf("handleTcpMessages success, data: %v", hex.EncodeToString(data))
@@ -266,7 +266,7 @@ func (t *TcpClient) HandleCheckTcpHeart(key string) {
go func() {
for {
select {
case <-timeoutChan:
case <-t.TimeoutChan:
globals.SugarLogger.Debugf("HandleCheckTcpHeart timeout")
return
default:
@@ -276,7 +276,7 @@ func (t *TcpClient) HandleCheckTcpHeart(key string) {
changePrinterStatus(key, printerStatusOffline)
if t.isExist(key) {
t.clear(key)
close(timeoutChan)
close(t.TimeoutChan)
return
}
}