From f308b863439128acffbeedf53f336a70b5b40f98 Mon Sep 17 00:00:00 2001 From: otto <965391514@qq.com> Date: Wed, 1 Nov 2023 17:26:28 +0800 Subject: [PATCH] up --- job1.yaml | 4 ++-- task/task.go | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/job1.yaml b/job1.yaml index 3a94066..3224113 100644 --- a/job1.yaml +++ b/job1.yaml @@ -11,8 +11,8 @@ spec: spec: containers: - name: hotspot-queue-job - image: harbor.homieyy.com/job/dev/hotspot-queue:364ceb13bf57f7e5029bdb23d657caa188c31e59 - command: ["main"] + image: harbor.homieyy.com/job/dev/hotspot-queue:04581463b6917ace4405069e132d6edca8433c6d + command: ["./main"] env: - name: JM_ENVIRONMENT value: dev diff --git a/task/task.go b/task/task.go index 1c6d45e..da793c1 100644 --- a/task/task.go +++ b/task/task.go @@ -53,7 +53,9 @@ func NewTask() { ctx := context.Background() lLen := redisClient.LLen(ctx, hotspotQueueKey).Val() if lLen == 0 { - return + fmt.Println("等待") + time.Sleep(time.Second * 10) + continue } result, err := redisClient.RPop(ctx, hotspotQueueKey).Result() if err != nil {