otto 9 months ago
parent
commit
bb6fa56723
  1. 2
      hotspot-clear-job-master.yaml
  2. 27
      task/task.go

2
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

27
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()
}

Loading…
Cancel
Save