This commit is contained in:
suyl
2021-07-30 18:42:17 +08:00
parent 472508634a
commit e55d4dfd4f
2 changed files with 3 additions and 5 deletions

View File

@@ -230,8 +230,9 @@ func (t *TcpClient) setPrintStatus(key string, status int) {
func (t *TcpClient) addMsgChan(printMsg *model.PrintMsg) {
t.Lock()
defer t.Unlock()
if !t.isExistMsg(printMsg.PrintNo) {
t.buildMsgMap(printMsg.PrintNo)
if t.MsgMap[printMsg.PrintNo] == nil {
dataChan := make(chan *model.PrintMsg, 1024)
t.MsgMap[printMsg.PrintNo] = dataChan
}
globals.SugarLogger.Debugf("addMsgChan msgID: %s", printMsg.MsgID)
t.MsgMap[printMsg.PrintNo] <- printMsg

View File

@@ -1,7 +1,6 @@
package dao
import (
"fmt"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/model"
"time"
@@ -51,8 +50,6 @@ func GetPrintMsgs(db *DaoDB, printNo string, statuss []int, beginAt, endAt time.
}
sql += " ORDER BY a.created_at LIMIT ? OFFSET ?"
sqlParams = append(sqlParams, pageSize, offset)
fmt.Println(sql)
fmt.Println(sqlParams)
err = GetRows(db, &prints, sql, sqlParams)
return prints, err
}