From c8678143c163a4d9ae734e6f918c2b24fca0e5bb Mon Sep 17 00:00:00 2001 From: suyl <770236076@qq.com> Date: Thu, 22 Jul 2021 15:03:53 +0800 Subject: [PATCH] aa --- business/jxstore/event/event_tcp.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/business/jxstore/event/event_tcp.go b/business/jxstore/event/event_tcp.go index e853d1216..bf07c08c2 100644 --- a/business/jxstore/event/event_tcp.go +++ b/business/jxstore/event/event_tcp.go @@ -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) } } }