|
|
@ -100,18 +100,21 @@ func task(start, end int64) error { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func wechatHook(times int64, err 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 { |
|
|
|
if err != nil { |
|
|
|
hook = hook.FontColor("失败", wechat.Warning).Br().Text("异常:").FontColor(err.Error(), wechat.Warning) |
|
|
|
envi := "测试" |
|
|
|
} else { |
|
|
|
if k8sclient.Environment() == k8sclient.MasterNamespace { |
|
|
|
hook = hook.FontColor("完成", wechat.Info) |
|
|
|
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() |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|