@@ -87,9 +87,6 @@ func doTask(fnName string) func() { | |||||
// 增加自动任务队列 | // 增加自动任务队列 | ||||
func initTasks() { | func initTasks() { | ||||
jobs[taskMd.CronEggEnergyAutoRecordPrices] = taskEggEnergyAutoRecordPrices | |||||
jobs[taskMd.CronEggEnergyDealPlatformRevenueData] = taskEggEnergyDealPlatformRevenueData | |||||
jobs[taskMd.CronEggEnergyDealFundData] = taskEggEnergyDealFundData | |||||
jobs[taskMd.AliyunSmsRecord] = taskAliyunSmsRecord //阿里云短信 | jobs[taskMd.AliyunSmsRecord] = taskAliyunSmsRecord //阿里云短信 | ||||
jobs[taskMd.JpushRecord] = taskJpushRecord //极光推送 | jobs[taskMd.JpushRecord] = taskJpushRecord //极光推送 | ||||
jobs[taskMd.NoLoginSend] = taskNoLoginSend //推送 或短信给 X小时没登陆的用户 | jobs[taskMd.NoLoginSend] = taskNoLoginSend //推送 或短信给 X小时没登陆的用户 | ||||
@@ -1,13 +1,9 @@ | |||||
package md | package md | ||||
const ( | const ( | ||||
CronEggEnergyAutoRecordPrices = "cron_egg_energy_auto_record_price" // 自动记录价格 | |||||
CronEggEnergyDealPlatformRevenueData = "cron_egg_energy_deal_platform_revenue_data" // 处理平台收益 | |||||
CronEggEnergyDealFundData = "cron_egg_energy_deal_fund_data" // 处理价值投入 | |||||
AliyunSmsRecord = "cron_egg_aliyun_sms_record" //阿里云短信 | |||||
JpushRecord = "cron_egg_jpush_record" //极光推送 | |||||
AliyunSmsRecord = "cron_egg_aliyun_sms_record" //阿里云短信 | |||||
JpushRecord = "cron_egg_jpush_record" //极光推送 | |||||
NoLoginSend = "cron_egg_no_login_send" //推送 或短信给 X小时没登陆的用户 | NoLoginSend = "cron_egg_no_login_send" //推送 或短信给 X小时没登陆的用户 | ||||
NoSignSend = "cron_egg_no_sign_send" //推送 或短信给 X小时没签到的用户 | NoSignSend = "cron_egg_no_sign_send" //推送 或短信给 X小时没签到的用户 | ||||
) | ) |
@@ -1,23 +0,0 @@ | |||||
package task | |||||
import ( | |||||
"applet/app/task/svc" | |||||
"math/rand" | |||||
"time" | |||||
"xorm.io/xorm" | |||||
) | |||||
// 自动记录价格 | |||||
func taskEggEnergyAutoRecordPrices(eg *xorm.Engine) { | |||||
for { | |||||
if len(ch) > workerNum { | |||||
time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000))) | |||||
} else { | |||||
goto START | |||||
} | |||||
} | |||||
START: | |||||
ch <- 1 | |||||
svc.EggEnergyAutoRecordPrices(eg) | |||||
<-ch | |||||
} |
@@ -1,23 +0,0 @@ | |||||
package task | |||||
import ( | |||||
"applet/app/task/svc" | |||||
"math/rand" | |||||
"time" | |||||
"xorm.io/xorm" | |||||
) | |||||
// 处理价值投入 | |||||
func taskEggEnergyDealFundData(eg *xorm.Engine) { | |||||
for { | |||||
if len(ch) > workerNum { | |||||
time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000))) | |||||
} else { | |||||
goto START | |||||
} | |||||
} | |||||
START: | |||||
ch <- 1 | |||||
svc.EggEnergyDealFundData(eg) | |||||
<-ch | |||||
} |
@@ -1,23 +0,0 @@ | |||||
package task | |||||
import ( | |||||
"applet/app/task/svc" | |||||
"math/rand" | |||||
"time" | |||||
"xorm.io/xorm" | |||||
) | |||||
// 处理平台收益 | |||||
func taskEggEnergyDealPlatformRevenueData(eg *xorm.Engine) { | |||||
for { | |||||
if len(ch) > workerNum { | |||||
time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000))) | |||||
} else { | |||||
goto START | |||||
} | |||||
} | |||||
START: | |||||
ch <- 1 | |||||
svc.EggEnergyDealPlatformRevenueData(eg) | |||||
<-ch | |||||
} |