From 5fab3eff96bc10ec4548768acecbfb79bc9ae120 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Thu, 12 Dec 2024 13:56:35 +0800 Subject: [PATCH 1/5] update --- app/task/svc/svc_egg_energy_deal_fund_data.go | 1 + app/task/svc/svc_egg_energy_deal_platform_revenue_data.go | 1 + 2 files changed, 2 insertions(+) diff --git a/app/task/svc/svc_egg_energy_deal_fund_data.go b/app/task/svc/svc_egg_energy_deal_fund_data.go index 48a494f..5bcabac 100644 --- a/app/task/svc/svc_egg_energy_deal_fund_data.go +++ b/app/task/svc/svc_egg_energy_deal_fund_data.go @@ -43,6 +43,7 @@ func EggEnergyDealFundData(eg *xorm.Engine) { ch, err := rabbit.Cfg.Pool.GetChannel() if err != nil { + fmt.Println("DealFundDataGetRabbitChannel_ERR:::::", err.Error()) return } defer ch.Release() diff --git a/app/task/svc/svc_egg_energy_deal_platform_revenue_data.go b/app/task/svc/svc_egg_energy_deal_platform_revenue_data.go index 541deca..c00f625 100644 --- a/app/task/svc/svc_egg_energy_deal_platform_revenue_data.go +++ b/app/task/svc/svc_egg_energy_deal_platform_revenue_data.go @@ -43,6 +43,7 @@ func EggEnergyDealPlatformRevenueData(eg *xorm.Engine) { ch, err := rabbit.Cfg.Pool.GetChannel() if err != nil { + fmt.Println("EggEnergyDealPlatformRevenueDataGetRabbitChannel_ERR:::::", err.Error()) return } defer ch.Release() From b6756092d1f80b14e099df0a74ee63931d15d4d4 Mon Sep 17 00:00:00 2001 From: shenjiachi Date: Thu, 12 Dec 2024 14:33:16 +0800 Subject: [PATCH 2/5] update --- app/task/svc/svc_egg_energy_deal_fund_data.go | 16 ++++++++-------- .../svc_egg_energy_deal_platform_revenue_data.go | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/app/task/svc/svc_egg_energy_deal_fund_data.go b/app/task/svc/svc_egg_energy_deal_fund_data.go index 5bcabac..a0ffb7d 100644 --- a/app/task/svc/svc_egg_energy_deal_fund_data.go +++ b/app/task/svc/svc_egg_energy_deal_fund_data.go @@ -19,11 +19,18 @@ func EggEnergyDealFundData(eg *xorm.Engine) { fmt.Println("egg_energy_deal_fund_data...") defer func() { if err := recover(); err != nil { - fmt.Println(err) + fmt.Println("DealFundDataGetRabbitChannel_ERR:::::", err) return } }() + ch, err := rabbit.Cfg.Pool.GetChannel() + if err != nil { + fmt.Println("DealFundDataGetRabbitChannel_ERR:::::", err.Error()) + return + } + defer ch.Release() + // 悲观锁防止串行 getString, _ := cache.GetString(EggEnergyDealFundDataKey) if getString != "" { @@ -41,13 +48,6 @@ func EggEnergyDealFundData(eg *xorm.Engine) { return } - ch, err := rabbit.Cfg.Pool.GetChannel() - if err != nil { - fmt.Println("DealFundDataGetRabbitChannel_ERR:::::", err.Error()) - return - } - defer ch.Release() - now := time.Now() fundDataRecordsDb := implement.NewEggEnergyFundDataRecordsDb(eg) for _, data := range fundDataList { diff --git a/app/task/svc/svc_egg_energy_deal_platform_revenue_data.go b/app/task/svc/svc_egg_energy_deal_platform_revenue_data.go index c00f625..a3a875e 100644 --- a/app/task/svc/svc_egg_energy_deal_platform_revenue_data.go +++ b/app/task/svc/svc_egg_energy_deal_platform_revenue_data.go @@ -19,11 +19,18 @@ func EggEnergyDealPlatformRevenueData(eg *xorm.Engine) { fmt.Println("egg_energy_deal_platform_revenue_data...") defer func() { if err := recover(); err != nil { - fmt.Println(err) + fmt.Println("EggEnergyDealPlatformRevenueDataGetRabbitChannel_ERR:::::", err) return } }() + ch, err := rabbit.Cfg.Pool.GetChannel() + if err != nil { + fmt.Println("EggEnergyDealPlatformRevenueDataGetRabbitChannel_ERR:::::", err.Error()) + return + } + defer ch.Release() + // 悲观锁防止串行 getString, _ := cache.GetString(EggEnergyDealPlatformRevenueDataKey) if getString != "" { @@ -41,13 +48,6 @@ func EggEnergyDealPlatformRevenueData(eg *xorm.Engine) { return } - ch, err := rabbit.Cfg.Pool.GetChannel() - if err != nil { - fmt.Println("EggEnergyDealPlatformRevenueDataGetRabbitChannel_ERR:::::", err.Error()) - return - } - defer ch.Release() - now := time.Now() recordsDb := implement.NewPlatformRevenueDataRecordsDb(eg) for _, data := range platformRevenueDataList { From a30a94792e29b20141e53c3692853e3a8a59107f Mon Sep 17 00:00:00 2001 From: dengbiao Date: Thu, 12 Dec 2024 14:33:27 +0800 Subject: [PATCH 3/5] update --- app/cfg/init_task.go | 2 ++ cmd/task/main.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/app/cfg/init_task.go b/app/cfg/init_task.go index 2a049fd..eff3e96 100644 --- a/app/cfg/init_task.go +++ b/app/cfg/init_task.go @@ -30,6 +30,8 @@ func InitTaskCfg() { IMDB = &conf.ImDB Log = &conf.Log RedisAddr = conf.RedisAddr + MQ = &conf.MQ + ES = &conf.ES } var MemCache mc.Cache diff --git a/cmd/task/main.go b/cmd/task/main.go index e6daccb..fb39639 100644 --- a/cmd/task/main.go +++ b/cmd/task/main.go @@ -20,6 +20,8 @@ func init() { cfg.InitLog() // 初始化redis cfg.InitCache() + cfg.InitMq() // 队列初始化 + cfg.InitEs() //ElasticSearch初始化 baseDb := *cfg.DB baseDb.Path = fmt.Sprintf(cfg.DB.Path, cfg.DB.Name) if err := db.InitDB(&baseDb); err != nil { From 72e3e61c5629325e15eb0c6008eee9e098dd9690 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Thu, 12 Dec 2024 18:21:32 +0800 Subject: [PATCH 4/5] updaste --- go.mod | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 57808ac..533fdaa 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.19 // replace code.fnuoos.com/EggPlanet/egg_models.git => E:/company/Egg/egg_models -//replace code.fnuoos.com/EggPlanet/egg_system_rules.git => E:/company/Egg/egg_system_rules +replace code.fnuoos.com/EggPlanet/egg_system_rules.git => E:/company/Egg/egg_system_rules require ( github.com/boombuler/barcode v1.0.1 @@ -16,7 +16,7 @@ require ( github.com/go-playground/universal-translator v0.18.1 github.com/go-playground/validator/v10 v10.20.0 github.com/go-redis/redis v6.15.9+incompatible - github.com/gomodule/redigo v2.0.0+incompatible + github.com/gomodule/redigo v1.9.2 github.com/jinzhu/copier v0.4.0 github.com/makiuchi-d/gozxing v0.0.0-20210324052758-57132e828831 github.com/qiniu/api.v7/v7 v7.8.2 @@ -34,7 +34,7 @@ require ( require ( code.fnuoos.com/EggPlanet/egg_models.git v0.2.1-0.20241211152610-0c5e1e903c99 - code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241211143147-17b736995b8f + code.fnuoos.com/EggPlanet/egg_system_rules.git v0.0.4-0.20241212100929-af11a5e94a68 code.fnuoos.com/go_rely_warehouse/zyos_go_es.git v1.0.1-0.20241118083738-0f22da9ba0be code.fnuoos.com/go_rely_warehouse/zyos_go_mq.git v0.0.5 github.com/360EntSecGroup-Skylar/excelize v1.4.1 @@ -44,7 +44,6 @@ require ( github.com/alibabacloud-go/tea v1.2.2 github.com/alibabacloud-go/tea-utils/v2 v2.0.6 github.com/aliyun/aliyun-oss-go-sdk v3.0.2+incompatible - github.com/gin-contrib/sessions v1.0.1 github.com/go-pay/gopay v1.5.98 github.com/go-sql-driver/mysql v1.8.1 github.com/gocolly/colly v1.2.0 From 506b66fe5a0c170f25363336672c08c9e116ea59 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Thu, 12 Dec 2024 18:22:47 +0800 Subject: [PATCH 5/5] update --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 533fdaa..b7a1ed0 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.19 // replace code.fnuoos.com/EggPlanet/egg_models.git => E:/company/Egg/egg_models -replace code.fnuoos.com/EggPlanet/egg_system_rules.git => E:/company/Egg/egg_system_rules +//replace code.fnuoos.com/EggPlanet/egg_system_rules.git => E:/company/Egg/egg_system_rules require ( github.com/boombuler/barcode v1.0.1