12345678910111213141516171819202122232425262728 |
- package data_stat
- import (
- "context"
- "errors"
- "eta/eta_task/services/data"
- "eta/eta_task/utils"
- "time"
- )
- // SetEdbSourceStatTask 设置数据源指标更新情况定时任务
- func SetEdbSourceStatTask(cont context.Context) (err error) {
- now := time.Now().Format(utils.FormatDate)
- if now <= "2023-12-04" { //上线之后隔天再执行
- return
- }
- utils.FileLog.Info("SetEdbSourceStatTask 开始")
- resp, err := data.SetEdbSourceStat()
- if err != nil {
- utils.FileLog.Info("SetEdbSourceStatTask 定时更新出错 Err:" + err.Error())
- return errors.New("SetEdbSourceStat Err:" + err.Error())
- }
- if resp.Ret != 200 {
- return errors.New("SetEdbSourceStat Err:" + resp.Msg + ";ErrMsg:" + resp.ErrMsg)
- }
- utils.FileLog.Info("SetEdbSourceStatTask 结束")
- return
- }
|