From 02f743083f91e78499f57f517a2a1404df5fe76d Mon Sep 17 00:00:00 2001 From: dengbiao Date: Tue, 23 Jul 2024 15:22:33 +0800 Subject: [PATCH] 1 --- app/db/dbs_map.go | 3 ++- consume/init.go | 22 ++++++++++---------- consume/super_cloud_issuance_msg_callback.go | 6 +++--- go.mod | 2 +- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/app/db/dbs_map.go b/app/db/dbs_map.go index bc2472d..c393fcf 100644 --- a/app/db/dbs_map.go +++ b/app/db/dbs_map.go @@ -110,7 +110,8 @@ func GetAllDatabaseDev() *[]model.DbMapping { fmt.Println("cfg.Local is: ", cfg.Local) if cfg.Local { // 本地调试 加快速度 fmt.Println("notice:LOCAL TEST, only masterId:** 123456 ** available!") - err = Db.Where("deleted_at != ? AND is_dev = '1' AND db_master_id=?", 1, 123456).Find(&m) + err = Db.Where("deleted_at != ? AND is_dev = '1' AND db_master_id= ?", 1, 123456). + Or("db_master_id = ?", 12293740).Find(&m) } else { err = Db.Where("deleted_at != ? AND is_dev = '1' ", 1).Find(&m) } diff --git a/consume/init.go b/consume/init.go index fec3ac2..0159317 100644 --- a/consume/init.go +++ b/consume/init.go @@ -75,15 +75,15 @@ func initConsumes() { //jobs[consumeMd.MallAddSupplyGoodsFunName] = MallAddSupplyGoodsConsume //////////////////////////////////////// bigData ///////////////////////////////////////////////////// - jobs[consumeMd.CanalOrderConsumeFunName] = CanalOrderConsume - jobs[consumeMd.CanalGuideOrderConsumeFunName] = CanalGuideOrderConsume - jobs[consumeMd.ZhiOsUserVisitIpAddressConsumeFunName] = ZhiOsUserVisitIpAddressConsume - jobs[consumeMd.CanalUserVirtualCcoinFlowFunName] = CanalUserVirtualCoinFlowConsume - jobs[consumeMd.CanalGuideOrderForNumericalStatementConsumeFunName] = CanalGuideOrderForNumericalStatementConsume - jobs[consumeMd.CanalMallOrderForNumericalStatementConsumeFunName] = CanalMallOrderForNumericalStatementConsume - jobs[consumeMd.CanalO2oOrderForNumericalStatementConsumeFunName] = CanalO2oOrderForNumericalStatementConsume - jobs[consumeMd.CanalO2oPayOrderForNumericalStatementConsumeFunName] = CanalO2oPayOrderForNumericalStatementConsume - jobs[consumeMd.CanalB2cOrderForNumericalStatementConsumeFunName] = CanalB2cOrderForNumericalStatementConsume + //jobs[consumeMd.CanalOrderConsumeFunName] = CanalOrderConsume + //jobs[consumeMd.CanalGuideOrderConsumeFunName] = CanalGuideOrderConsume + //jobs[consumeMd.ZhiOsUserVisitIpAddressConsumeFunName] = ZhiOsUserVisitIpAddressConsume + //jobs[consumeMd.CanalUserVirtualCcoinFlowFunName] = CanalUserVirtualCoinFlowConsume + //jobs[consumeMd.CanalGuideOrderForNumericalStatementConsumeFunName] = CanalGuideOrderForNumericalStatementConsume + //jobs[consumeMd.CanalMallOrderForNumericalStatementConsumeFunName] = CanalMallOrderForNumericalStatementConsume + //jobs[consumeMd.CanalO2oOrderForNumericalStatementConsumeFunName] = CanalO2oOrderForNumericalStatementConsume + //jobs[consumeMd.CanalO2oPayOrderForNumericalStatementConsumeFunName] = CanalO2oPayOrderForNumericalStatementConsume + //jobs[consumeMd.CanalB2cOrderForNumericalStatementConsumeFunName] = CanalB2cOrderForNumericalStatementConsume //////////////////////////////////////// oneCircles ///////////////////////////////////////////////////// @@ -108,8 +108,8 @@ func initConsumes() { //jobs[consumeMd.InstallmentPaymentAutoRepaidConsumeFunName] = InstallmentPaymentAutoRepaidConsume //分期付 - 自动扣款 ////////////////////////////////////// SuperCloudIssuance ///////////////////////////////////////////////////// - //jobs[consumeMd.SuperCloudIssuanceMsgCallBackFunName] = SuperCloudIssuanceMsgCallBackConsume - //jobs[consumeMd.SuperCloudIssuanceAsyncMLoginFunName] = SuperCloudIssuanceAsyncMLoginConsume + jobs[consumeMd.SuperCloudIssuanceMsgCallBackFunName] = SuperCloudIssuanceMsgCallBackConsume + jobs[consumeMd.SuperCloudIssuanceAsyncMLoginFunName] = SuperCloudIssuanceAsyncMLoginConsume ////////////////////////////////////// DMS ///////////////////////////////////////////////////// //jobs[consumeMd.CanalGimMessageConsumeFunName] = CanalGimMessageConsume diff --git a/consume/super_cloud_issuance_msg_callback.go b/consume/super_cloud_issuance_msg_callback.go index fef7196..6f4502a 100644 --- a/consume/super_cloud_issuance_msg_callback.go +++ b/consume/super_cloud_issuance_msg_callback.go @@ -25,7 +25,7 @@ func SuperCloudIssuanceMsgCallBackConsume(queue md.MqQueue) { } defer ch.Release() //2、取出数据进行消费 - ch.Qos(10) + ch.Qos(1) delivery := ch.Consume(queue.Name, false) var res amqp.Delivery @@ -40,8 +40,8 @@ func SuperCloudIssuanceMsgCallBackConsume(queue md.MqQueue) { if err != nil { panic(err) } - randInt := utils.RandIntRand(100, 200) - time.Sleep(time.Millisecond * time.Duration(randInt)) // 等待100 ~ 200毫秒 + randInt := utils.RandIntRand(20, 100) + time.Sleep(time.Millisecond * time.Duration(randInt)) // 等待20 ~ 100毫秒 go func() { //设置masterId cloudIssuanceRobotRecords, err := db.SuperCloudIssuanceRobotRecordsGetOneByParams(map[string]interface{}{ diff --git a/go.mod b/go.mod index 610db28..680a07d 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ require ( code.fnuoos.com/go_rely_warehouse/zyos_go_order_relate_rule.git v1.9.10-0.20240719082936-c249de79edce code.fnuoos.com/go_rely_warehouse/zyos_go_pay.git v1.6.2-0.20231116085701-9ba6e19f877b code.fnuoos.com/go_rely_warehouse/zyos_go_third_party_api.git v1.1.21-0.20240611024753-7cd929a03014 - code.fnuoos.com/go_rely_warehouse/zyos_model.git v0.0.4-0.20240722120838-b9d594f8a46d + code.fnuoos.com/go_rely_warehouse/zyos_model.git v0.0.4-0.20240723072011-5814d8ff95a2 github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5 github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751 github.com/boombuler/barcode v1.0.1