Kaynağa Gözat

Merge remote-tracking branch 'origin/master'

master
huangjiajun 6 gün önce
ebeveyn
işleme
be4db7e873
5 değiştirilmiş dosya ile 22 ekleme ve 17 silme
  1. +2
    -0
      app/cfg/init_task.go
  2. +8
    -7
      app/task/svc/svc_egg_energy_deal_fund_data.go
  3. +8
    -7
      app/task/svc/svc_egg_energy_deal_platform_revenue_data.go
  4. +2
    -0
      cmd/task/main.go
  5. +2
    -3
      go.mod

+ 2
- 0
app/cfg/init_task.go Dosyayı Görüntüle

@@ -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


+ 8
- 7
app/task/svc/svc_egg_energy_deal_fund_data.go Dosyayı Görüntüle

@@ -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,12 +48,6 @@ func EggEnergyDealFundData(eg *xorm.Engine) {
return
}

ch, err := rabbit.Cfg.Pool.GetChannel()
if err != nil {
return
}
defer ch.Release()

now := time.Now()
fundDataRecordsDb := implement.NewEggEnergyFundDataRecordsDb(eg)
for _, data := range fundDataList {


+ 8
- 7
app/task/svc/svc_egg_energy_deal_platform_revenue_data.go Dosyayı Görüntüle

@@ -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,12 +48,6 @@ func EggEnergyDealPlatformRevenueData(eg *xorm.Engine) {
return
}

ch, err := rabbit.Cfg.Pool.GetChannel()
if err != nil {
return
}
defer ch.Release()

now := time.Now()
recordsDb := implement.NewPlatformRevenueDataRecordsDb(eg)
for _, data := range platformRevenueDataList {


+ 2
- 0
cmd/task/main.go Dosyayı Görüntüle

@@ -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 {


+ 2
- 3
go.mod Dosyayı Görüntüle

@@ -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


Yükleniyor…
İptal
Kaydet