From e55d4dfd4f5ef4b0d5fa28050ee151e064766516 Mon Sep 17 00:00:00 2001 From: suyl <770236076@qq.com> Date: Fri, 30 Jul 2021 18:42:17 +0800 Subject: [PATCH] aa --- business/jxstore/event/event_tcp_utils.go | 5 +++-- business/model/dao/dao_print.go | 3 --- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/business/jxstore/event/event_tcp_utils.go b/business/jxstore/event/event_tcp_utils.go index 23bc5cdfc..867552742 100644 --- a/business/jxstore/event/event_tcp_utils.go +++ b/business/jxstore/event/event_tcp_utils.go @@ -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 diff --git a/business/model/dao/dao_print.go b/business/model/dao/dao_print.go index dbfba68ac..831819779 100644 --- a/business/model/dao/dao_print.go +++ b/business/model/dao/dao_print.go @@ -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 }