From ed7e2b2c6913c04e87a6231cc4854cef0c1ac09d Mon Sep 17 00:00:00 2001 From: suyl <770236076@qq.com> Date: Tue, 29 Jun 2021 09:16:47 +0800 Subject: [PATCH] aa --- business/jxstore/event/event_tcp.go | 3 ++- business/model/dao/dao_print.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/business/jxstore/event/event_tcp.go b/business/jxstore/event/event_tcp.go index 03775ef18..04a3b7ac1 100644 --- a/business/jxstore/event/event_tcp.go +++ b/business/jxstore/event/event_tcp.go @@ -13,6 +13,7 @@ import ( "strconv" "strings" "sync" + "time" ) const ( @@ -153,8 +154,8 @@ func HandleTcpMessages() { for { //一直读? var err error + time.Sleep(time.Second / 2) prints, _ := dao.GetPrintMsgs(db, printMsgWait, offset, pageSize) - globals.SugarLogger.Debugf("HandleTcpMessages, len prints: [%v]", len(prints)) for _, printMsg := range prints { if printMsg != nil { if err = checkPrintMsg(printMsg); err == nil { diff --git a/business/model/dao/dao_print.go b/business/model/dao/dao_print.go index 992684995..311e0e97a 100644 --- a/business/model/dao/dao_print.go +++ b/business/model/dao/dao_print.go @@ -29,7 +29,7 @@ func GetPrintMsgs(db *DaoDB, status, offset, pageSize int) (prints []*model.Prin FROM print_msg WHERE 1 = 1 AND status = ? - LIMIT ? OFFSET + LIMIT ? OFFSET ? ` sqlParams := []interface{}{status, pageSize, offset} err = GetRows(db, &prints, sql, sqlParams)