From c16a640fe16e46fc5e97eec08cf7b0f42feb79ce Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 14 Sep 2023 19:00:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/db/db_new_acquisition_cfg.go | 2 +- consume/zhios_acquisition_condition.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/db/db_new_acquisition_cfg.go b/app/db/db_new_acquisition_cfg.go index 65e94ef..9f21aff 100644 --- a/app/db/db_new_acquisition_cfg.go +++ b/app/db/db_new_acquisition_cfg.go @@ -13,7 +13,7 @@ func GetAcquisitionCfg(eg *xorm.Engine, id string, createAt time.Time) *md.Acqui var get bool var err error if utils.StrToInt(id) == 0 { - get, err = eg.Where("start_time<=? and end_time>=? and is_show=?", createAt, createAt, 1).Get(&data) + get, err = eg.Where("start_time<=? and end_time>=? and is_show=?", createAt.Format("2006-01-02 15:04:05"), createAt.Format("2006-01-02 15:04:05"), 1).Get(&data) } else { get, err = eg.Where("id=?", id).Get(&data) } diff --git a/consume/zhios_acquisition_condition.go b/consume/zhios_acquisition_condition.go index 0517477..281ee89 100644 --- a/consume/zhios_acquisition_condition.go +++ b/consume/zhios_acquisition_condition.go @@ -26,7 +26,7 @@ func ZhiosAcquisitionCondition(queue md.MqQueue) { //1、将自己绑定到交换机上 ch.Bind(queue.Name, queue.ExchangeName, queue.RoutKey) //2、取出数据进行消费 - ch.Qos(100) + ch.Qos(300) delivery := ch.Consume(queue.Name, false) var res amqp.Delivery @@ -40,7 +40,7 @@ func ZhiosAcquisitionCondition(queue md.MqQueue) { //_ = res.Reject(false) fmt.Println(err) if err == nil { - _ = res.Ack(true) + //_ = res.Ack(true) } else { var canalMsg *md.ZhiosAcquisition var tmpString string @@ -80,9 +80,9 @@ func handleZhiosAcquisition(msg []byte) error { if eg == nil { return nil } - //if canalMsg.Uid == "" { - // return nil - //} + if canalMsg.Uid == "" { + return nil + } userInfo, _ := db.UserFindByID(eg, canalMsg.Uid) if userInfo == nil { return nil