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