aa
This commit is contained in:
@@ -231,10 +231,8 @@ func (t *TcpClient) doPrint(key string) (err error) {
|
|||||||
printMsg.Comment = err.Error()
|
printMsg.Comment = err.Error()
|
||||||
dao.UpdateEntity(db, printMsg, "Status", "Comment")
|
dao.UpdateEntity(db, printMsg, "Status", "Comment")
|
||||||
if t.isExist(key) {
|
if t.isExist(key) {
|
||||||
timeoutChan <- 1
|
|
||||||
timeoutChan <- 1
|
|
||||||
timeoutChan <- 1
|
|
||||||
t.clear(key)
|
t.clear(key)
|
||||||
|
close(timeoutChan)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
@@ -243,10 +241,8 @@ func (t *TcpClient) doPrint(key string) (err error) {
|
|||||||
globals.SugarLogger.Debugf("handleTcpMessages err [%v]", err)
|
globals.SugarLogger.Debugf("handleTcpMessages err [%v]", err)
|
||||||
//t.delConn(printMsg.PrintNo)
|
//t.delConn(printMsg.PrintNo)
|
||||||
if t.isExist(key) {
|
if t.isExist(key) {
|
||||||
timeoutChan <- 1
|
|
||||||
timeoutChan <- 1
|
|
||||||
timeoutChan <- 1
|
|
||||||
t.clear(key)
|
t.clear(key)
|
||||||
|
close(timeoutChan)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
@@ -279,10 +275,8 @@ func (t *TcpClient) HandleCheckTcpHeart(key string) {
|
|||||||
if time.Now().Sub(t.getPrintStatusTime(key)) > time.Minute*2 {
|
if time.Now().Sub(t.getPrintStatusTime(key)) > time.Minute*2 {
|
||||||
changePrinterStatus(key, printerStatusOffline)
|
changePrinterStatus(key, printerStatusOffline)
|
||||||
if t.isExist(key) {
|
if t.isExist(key) {
|
||||||
timeoutChan <- 1
|
|
||||||
timeoutChan <- 1
|
|
||||||
timeoutChan <- 1
|
|
||||||
t.clear(key)
|
t.clear(key)
|
||||||
|
close(timeoutChan)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ var (
|
|||||||
regexpQrr = regexp.MustCompile(byteSignQrRight + "(.*?)" + byteSignQrRightE)
|
regexpQrr = regexp.MustCompile(byteSignQrRight + "(.*?)" + byteSignQrRightE)
|
||||||
regexpSound = regexp.MustCompile(byteSignSound + "(.*?)" + byteSignSoundE)
|
regexpSound = regexp.MustCompile(byteSignSound + "(.*?)" + byteSignSoundE)
|
||||||
|
|
||||||
timeoutChan = make(chan int, 3)
|
timeoutChan = make(chan bool)
|
||||||
)
|
)
|
||||||
|
|
||||||
type PrintInfo struct {
|
type PrintInfo struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user