@@ -90,4 +90,5 @@ func initTasks() { | |||||
jobs[taskMd.CronEggEnergyAutoRecordPrices] = taskEggEnergyAutoRecordPrices | jobs[taskMd.CronEggEnergyAutoRecordPrices] = taskEggEnergyAutoRecordPrices | ||||
jobs[taskMd.CronEggEnergyDealPlatformRevenueData] = taskEggEnergyDealPlatformRevenueData | jobs[taskMd.CronEggEnergyDealPlatformRevenueData] = taskEggEnergyDealPlatformRevenueData | ||||
jobs[taskMd.CronEggEnergyDealFundData] = taskEggEnergyDealFundData | jobs[taskMd.CronEggEnergyDealFundData] = taskEggEnergyDealFundData | ||||
jobs[taskMd.CronEggEnergyUserEggScore] = taskCronEggEnergyUserEggScore | |||||
} | } |
@@ -4,4 +4,5 @@ const ( | |||||
CronEggEnergyAutoRecordPrices = "cron_egg_energy_auto_record_price" // 自动记录价格 | CronEggEnergyAutoRecordPrices = "cron_egg_energy_auto_record_price" // 自动记录价格 | ||||
CronEggEnergyDealPlatformRevenueData = "cron_egg_energy_deal_platform_revenue_data" // 处理平台收益 | CronEggEnergyDealPlatformRevenueData = "cron_egg_energy_deal_platform_revenue_data" // 处理平台收益 | ||||
CronEggEnergyDealFundData = "cron_egg_energy_deal_fund_data" // 处理价值投入 | CronEggEnergyDealFundData = "cron_egg_energy_deal_fund_data" // 处理价值投入 | ||||
CronEggEnergyUserEggScore = "cron_egg_energy_user_egg_score" // 处理蛋蛋分 | |||||
) | ) |
@@ -0,0 +1,19 @@ | |||||
package svc | |||||
import ( | |||||
"fmt" | |||||
"xorm.io/xorm" | |||||
) | |||||
// AutoScoreEggEnergyUserEggScore 自动给用户蛋蛋分打分 | |||||
func AutoScoreEggEnergyUserEggScore(engine *xorm.Engine) { | |||||
fmt.Println("auto_score_egg_energy_user_egg_score...") | |||||
defer func() { | |||||
if err := recover(); err != nil { | |||||
fmt.Println(err) | |||||
return | |||||
} | |||||
}() | |||||
return | |||||
} |
@@ -0,0 +1,23 @@ | |||||
package task | |||||
import ( | |||||
"applet/app/task/svc" | |||||
"math/rand" | |||||
"time" | |||||
"xorm.io/xorm" | |||||
) | |||||
// 处理蛋蛋分 | |||||
func taskCronEggEnergyUserEggScore(eg *xorm.Engine) { | |||||
for { | |||||
if len(ch) > workerNum { | |||||
time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000))) | |||||
} else { | |||||
goto START | |||||
} | |||||
} | |||||
START: | |||||
ch <- 1 | |||||
svc.AutoScoreEggEnergyUserEggScore(eg) | |||||
<-ch | |||||
} |
@@ -60,4 +60,12 @@ mq: | |||||
es: | es: | ||||
url: 'http://120.55.48.175:9200' | url: 'http://120.55.48.175:9200' | ||||
user: 'elastic' | user: 'elastic' | ||||
pwd: 'fnuo123' | |||||
pwd: 'fnuo123' | |||||
im_business_rpc: | |||||
url: im-rpc-business.izhim.com | |||||
port: 1005 | |||||
im_logic_rpc: | |||||
url: im-rpc-logic.izhim.com | |||||
port: 1008 |