aa
This commit is contained in:
@@ -372,6 +372,18 @@ func HandleTcpMessages() {
|
|||||||
printMsgChan <- printMsg
|
printMsgChan <- printMsg
|
||||||
printMsg.Status = printMsgAlreadyLoad
|
printMsg.Status = printMsgAlreadyLoad
|
||||||
dao.UpdateEntity(db, printMsg, "Status")
|
dao.UpdateEntity(db, printMsg, "Status")
|
||||||
|
for {
|
||||||
|
select {
|
||||||
|
case obj, _ := <-printMsgChan:
|
||||||
|
if _, ok := obj.(*model.PrintMsg); !ok {
|
||||||
|
if data, ok2 := obj.(string); ok2 {
|
||||||
|
changePrintMsg(data)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -383,7 +395,6 @@ func doPrint2(printMsgChan chan interface{}) (err error) {
|
|||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case obj, _ := <-printMsgChan:
|
case obj, _ := <-printMsgChan:
|
||||||
fmt.Println("qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq", utils.Format4Output(obj, true))
|
|
||||||
printMsg, ok := obj.(*model.PrintMsg)
|
printMsg, ok := obj.(*model.PrintMsg)
|
||||||
if ok {
|
if ok {
|
||||||
var (
|
var (
|
||||||
@@ -431,10 +442,6 @@ func doPrint2(printMsgChan chan interface{}) (err error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
data, _ := <-printMsgChan
|
|
||||||
dataStr := data.(string)
|
|
||||||
changePrintMsg(dataStr)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user