This commit is contained in:
suyl
2021-07-22 15:03:53 +08:00
parent 68b6324365
commit c8678143c1

View File

@@ -372,7 +372,6 @@ func HandleTcpMessages() {
for _, printMsg := range prints {
printMsg.Status = printMsgAlreadyLoad
dao.UpdateEntity(db, printMsg, "Status")
}
}
}
@@ -383,10 +382,7 @@ func doPrint2(printMsgChan chan *model.PrintMsg) (err error) {
)
for {
select {
case data, _ := <-printMsgCallbackChan:
changePrintMsg(data)
default:
printMsg, _ := <-printMsgChan
case printMsg, _ := <-printMsgChan:
var (
data []byte
c net.Conn
@@ -429,6 +425,8 @@ func 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", "Comment")
dataStr := <-printMsgCallbackChan
changePrintMsg(dataStr)
}
}
}