This commit is contained in:
suyl
2021-07-30 10:55:09 +08:00
parent e092178d32
commit 143d3dc858
2 changed files with 3 additions and 9 deletions

View File

@@ -297,14 +297,9 @@ func (t *TcpClient) doPrint2(printMsgChan chan *model.PrintMsg) (err error) {
globals.SugarLogger.Debugf("handleTcpMessages success, data: %v", hex.EncodeToString(data))
//printMsg.Status = printMsgAlreadySend
//dao.UpdateEntity(db, printMsg, "Status")
if t.CallBackMap[printMsg.PrintNo] != nil {
select {
case dataStr := <-t.CallBackMap[printMsg.PrintNo]:
a, b := getCallbackMsgInfo(dataStr)
t.changePrintMsg(dataStr, a, b)
case <-timeoutChan:
}
}
dataStr := <-t.CallBackMap[printMsg.PrintNo]
a, b := getCallbackMsgInfo(dataStr)
t.changePrintMsg(dataStr, a, b)
//dataStr := <-printMsgCallbackChan
}
}

View File

@@ -149,7 +149,6 @@ func (t *TcpClient) buildCallBackMap(key string) {
defer t.Unlock()
dataChan := make(chan string, 1024)
t.CallBackMap[key] = dataChan
timeoutChan <- 1
}
func (t *TcpClient) getPrintStatus(key string) int {