diff --git a/hotspot-clear-job-master.yaml b/hotspot-clear-job-master.yaml index 407bf7b..956f339 100644 --- a/hotspot-clear-job-master.yaml +++ b/hotspot-clear-job-master.yaml @@ -14,7 +14,7 @@ spec: spec: containers: - name: hotspot-clear - image: 192.168.0.19:5000/job/master/hotspot-clear:77828635aff0ab0eb0992c381e668db2f29fd979 + image: 192.168.0.19:5000/job/master/hotspot-clear:5ea4b60e8364579d393c5c46088cb1d0b58135ff imagePullPolicy: Always env: - name: JM_ENVIRONMENT diff --git a/task/task.go b/task/task.go index 92f6c09..37576f5 100644 --- a/task/task.go +++ b/task/task.go @@ -100,18 +100,21 @@ func task(start, end int64) error { } func wechatHook(times int64, err error) { - envi := "测试" - if k8sclient.Environment() == k8sclient.MasterNamespace { - envi = "正式" - } - hook := wechat.NewMarkdown("https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=00dd9216-1f50-42be-8fe1-e66640d7bb27"). - Title(1, "直播间热度清理").Br(). - Text("环境:" + envi).Br(). - Text("耗时:" + strconv.Itoa(int(times)) + "s").Br().Text("状态:") if err != nil { - hook = hook.FontColor("失败", wechat.Warning).Br().Text("异常:").FontColor(err.Error(), wechat.Warning) - } else { - hook = hook.FontColor("完成", wechat.Info) + envi := "测试" + if k8sclient.Environment() == k8sclient.MasterNamespace { + envi = "正式" + } + hook := wechat.NewMarkdown("https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=00dd9216-1f50-42be-8fe1-e66640d7bb27"). + Title(1, "直播间热度清理").Br(). + Text("环境:" + envi).Br(). + Text("耗时:" + strconv.Itoa(int(times)) + "s").Br().Text("状态:") + if err != nil { + hook = hook.FontColor("失败", wechat.Warning).Br().Text("异常:").FontColor(err.Error(), wechat.Warning) + } else { + hook = hook.FontColor("完成", wechat.Info) + } + _ = hook.Send() } - _ = hook.Send() + }