From ab3a7636d61f9d78abcd8fcf2751501c92d0d3c5 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Thu, 24 Oct 2024 16:20:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/task/init.go | 9 +++++---- app/task/md/cron_key.go | 1 + app/task/task_tik_tok_chanxuan_pay.go | 21 +++++++++++++++++++++ 3 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 app/task/task_tik_tok_chanxuan_pay.go diff --git a/app/task/init.go b/app/task/init.go index e2b3a05..e5ed70b 100644 --- a/app/task/init.go +++ b/app/task/init.go @@ -90,10 +90,11 @@ func initTasks() { jobs[taskMd.ZhimengCronCinema5bmsOrder] = taskCinema5bmsOrder // jobs[taskMd.ZhimengCronCinema5bmsYesterOrder] = taskCinema5bmsYesterOrder // - jobs[taskMd.ZhimengCronTikTokCsjp] = taskTikTokCsjp // - jobs[taskMd.ZhimengCronTikTokCsjpActivity] = taskTikTokCsjpActivity // - jobs[taskMd.ZhimengCronTikTokCsjpLive] = taskTikTokCsjpLive // - jobs[taskMd.ZhimengCronTikTokChanxuan] = taskTikTokCsjpChanxuan // + jobs[taskMd.ZhimengCronTikTokCsjp] = taskTikTokCsjp // + jobs[taskMd.ZhimengCronTikTokCsjpActivity] = taskTikTokCsjpActivity // + jobs[taskMd.ZhimengCronTikTokCsjpLive] = taskTikTokCsjpLive // + jobs[taskMd.ZhimengCronTikTokChanxuan] = taskTikTokCsjpChanxuan // + jobs[taskMd.ZhimengCronTikTokChanxuanPay] = taskTikTokCsjpChanxuanPay // jobs[taskMd.ZhimengCronTikTokTask] = taskTikTokTask // jobs[taskMd.ZhimengCronTikTokTaskRelate] = taskTikTokTaskRelate // diff --git a/app/task/md/cron_key.go b/app/task/md/cron_key.go index de05ae0..4b79632 100644 --- a/app/task/md/cron_key.go +++ b/app/task/md/cron_key.go @@ -4,6 +4,7 @@ const ( ZhimengCronTikTokTaskRelate = "zhimeng_cron_tik_tok_relate" ZhimengCronTikTokCsjp = "zhimeng_cron_tik_tok_csjp" ZhimengCronTikTokChanxuan = "zhimeng_cron_tik_tok_chanxuan" + ZhimengCronTikTokChanxuanPay = "zhimeng_cron_tik_tok_chanxuan_pay" ZhimengCronCinema5bms = "zhimeng_cron_cinema5bms" ZhimengCronPLayletBihaiOrder = "zhimeng_cron_playlet_bihai_order" ZhimengCronCinema5bmsOrder = "zhimeng_cron_cinema5bms_order" diff --git a/app/task/task_tik_tok_chanxuan_pay.go b/app/task/task_tik_tok_chanxuan_pay.go new file mode 100644 index 0000000..f529ae0 --- /dev/null +++ b/app/task/task_tik_tok_chanxuan_pay.go @@ -0,0 +1,21 @@ +package task + +import ( + "applet/app/task/svc" + "math/rand" + "time" +) + +func taskTikTokCsjpChanxuanPay() { + for { + if len(ch) > workerNum { + time.Sleep(time.Millisecond * time.Duration(rand.Intn(1000))) + } else { + goto START + } + } +START: + ch <- 1 + svc.TikTokChanxuan(1) + <-ch +}