This commit is contained in:
suyl
2021-08-02 17:35:35 +08:00
parent e44a4d854e
commit 5c5a34aab7
2 changed files with 4 additions and 10 deletions

View File

@@ -231,10 +231,8 @@ func (t *TcpClient) doPrint(key string) (err error) {
printMsg.Comment = err.Error()
dao.UpdateEntity(db, printMsg, "Status", "Comment")
if t.isExist(key) {
timeoutChan <- 1
timeoutChan <- 1
timeoutChan <- 1
t.clear(key)
close(timeoutChan)
}
return
} else {
@@ -243,10 +241,8 @@ func (t *TcpClient) doPrint(key string) (err error) {
globals.SugarLogger.Debugf("handleTcpMessages err [%v]", err)
//t.delConn(printMsg.PrintNo)
if t.isExist(key) {
timeoutChan <- 1
timeoutChan <- 1
timeoutChan <- 1
t.clear(key)
close(timeoutChan)
}
return
} else {
@@ -279,10 +275,8 @@ func (t *TcpClient) HandleCheckTcpHeart(key string) {
if time.Now().Sub(t.getPrintStatusTime(key)) > time.Minute*2 {
changePrinterStatus(key, printerStatusOffline)
if t.isExist(key) {
timeoutChan <- 1
timeoutChan <- 1
timeoutChan <- 1
t.clear(key)
close(timeoutChan)
return
}
}

View File

@@ -108,7 +108,7 @@ var (
regexpQrr = regexp.MustCompile(byteSignQrRight + "(.*?)" + byteSignQrRightE)
regexpSound = regexp.MustCompile(byteSignSound + "(.*?)" + byteSignSoundE)
timeoutChan = make(chan int, 3)
timeoutChan = make(chan bool)
)
type PrintInfo struct {