From 3defe42b9ebcb87c67f99daa64f53beb7951b35d Mon Sep 17 00:00:00 2001 From: otto <965391514@qq.com> Date: Tue, 7 Nov 2023 16:35:48 +0800 Subject: [PATCH] up --- job-master.yaml | 21 +++++++++++++++++++++ task/task.go | 10 +++++----- 2 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 job-master.yaml diff --git a/job-master.yaml b/job-master.yaml new file mode 100644 index 0000000..9cf0ad9 --- /dev/null +++ b/job-master.yaml @@ -0,0 +1,21 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: hotspot-queue-job + namespace: master +spec: + parallelism: 1 + template: + metadata: + name: hotspot-queue-job + spec: + containers: + - name: hotspot-queue-job + image: harbor.homieyy.com/job/master/hotspot-queue:04581463b6917ace4405069e132d6edca8433c6d + command: ["./main"] + env: + - name: JM_ENVIRONMENT + value: master + restartPolicy: OnFailure + imagePullSecrets: + - name: registry-harbor \ No newline at end of file diff --git a/task/task.go b/task/task.go index 2d05f3e..bb1b431 100644 --- a/task/task.go +++ b/task/task.go @@ -50,7 +50,7 @@ func NewTask() { ctx := context.Background() lLen := redisClient.LLen(ctx, hotspotQueueKey).Val() if lLen == 0 { - fmt.Println("等待") + //fmt.Println("等待") time.Sleep(time.Second * 10) continue } @@ -158,10 +158,10 @@ func NewTask() { // 总人数【一天内】+(实时在线人数/总人数)* 10 = 人数热度值 // 总流水【一个星期内】 * 10 = 流水热度值 //currentOnlineTotal + (todayOnlineTotal * todayOnlineTotal) * 10 - fmt.Println("amountTotal:", (todayOnlineTotal*todayOnlineTotal)*10) - fmt.Println("amountTotal:", amountTotal*10) + //fmt.Println("amountTotal:", (todayOnlineTotal*todayOnlineTotal)*10) + //fmt.Println("amountTotal:", amountTotal*10) v := value + currentOnlineTotal + (todayOnlineTotal*todayOnlineTotal)*10 + amountTotal*10 - fmt.Println(v) + //fmt.Println(v) //usecase.logger.Info("实际人数:", onlineTotal) //usecase.logger.Info("总流水:", amountTotal) //usecase.logger.Info("十分钟之前总数:", lastOnlineTotal) @@ -189,5 +189,5 @@ func NewTask() { continue } } - fmt.Println("结束") + //fmt.Println("结束") }