aa
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user