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)