This commit is contained in:
suyl
2021-07-22 11:57:16 +08:00
parent 83cf5d536b
commit 078bdedfa9

View File

@@ -373,10 +373,15 @@ func HandleTcpMessages() {
prints, _ := dao.GetPrintMsgs(db, []int{printMsgWait}, time.Now().Add(-time.Hour*3), time.Now(), offset, pageSize)
for _, printMsg := range prints {
printMsgChan <- printMsg
//select {
//case data, _ := <-printMsgCallbackChan:
// changePrintMsg(data)
//}
Loop:
for {
select {
case data, _ := <-printMsgCallbackChan:
changePrintMsg(data)
default:
break Loop
}
}
}
}
}
@@ -386,10 +391,6 @@ func doPrint2(printMsgChan chan *model.PrintMsg) (err error) {
db = dao.GetDB()
)
for {
select {
case data, _ := <-printMsgCallbackChan:
changePrintMsg(data)
default:
select {
case printMsg, _ := <-printMsgChan:
var (
@@ -439,7 +440,6 @@ func doPrint2(printMsgChan chan *model.PrintMsg) (err error) {
}
}
}
}
return err
}