|
@@ -8,6 +8,7 @@ import (
|
|
|
"hongze/hongze_task/models/data_manage"
|
|
|
"hongze/hongze_task/services/alarm_msg"
|
|
|
"hongze/hongze_task/utils"
|
|
|
+ "strings"
|
|
|
"sync"
|
|
|
)
|
|
|
|
|
@@ -1484,11 +1485,17 @@ func RefreshDataFromZz(wg *sync.WaitGroup) (err error) {
|
|
|
|
|
|
// RefreshDataFromLt 刷新路透数据
|
|
|
func RefreshDataFromLt(wg *sync.WaitGroup) (err error) {
|
|
|
+ errMsgList := make([]string,0)
|
|
|
defer func() {
|
|
|
- if err != nil {
|
|
|
- fmt.Println("RefreshDataFromLt Err:" + err.Error())
|
|
|
+ //if err != nil {
|
|
|
+ // fmt.Println("RefreshDataFromLt Err:" + err.Error())
|
|
|
+ // //go utils.SendEmail(utils.APPNAME+"【"+utils.RunMode+"】"+"失败提醒", "RefreshDataFromLt ErrMsg:"+err.Error(), utils.EmailSendToUsers)
|
|
|
+ // go alarm_msg.SendAlarmMsg("RefreshDataFromLt ErrMsg:"+err.Error(), 3)
|
|
|
+ //}
|
|
|
+ if len(errMsgList)>0{
|
|
|
+ fmt.Println("RefreshDataFromLt Err:" , errMsgList)
|
|
|
//go utils.SendEmail(utils.APPNAME+"【"+utils.RunMode+"】"+"失败提醒", "RefreshDataFromLt ErrMsg:"+err.Error(), utils.EmailSendToUsers)
|
|
|
- go alarm_msg.SendAlarmMsg("RefreshDataFromLt ErrMsg:"+err.Error(), 3)
|
|
|
+ go alarm_msg.SendAlarmMsg("RefreshDataFromLt ErrMsg:"+strings.Join(errMsgList,`<br/>`), 3)
|
|
|
}
|
|
|
wg.Done()
|
|
|
}()
|
|
@@ -1498,6 +1505,7 @@ func RefreshDataFromLt(wg *sync.WaitGroup) (err error) {
|
|
|
pars = append(pars, utils.DATA_SOURCE_LT)
|
|
|
items, err := data_manage.GetEdbInfoByCondition(condition, pars, 0)
|
|
|
if err != nil {
|
|
|
+ errMsgList = append(errMsgList,"GetEdbInfoByCondition:" + err.Error())
|
|
|
return errors.New("GetEdbInfoByCondition:" + err.Error())
|
|
|
}
|
|
|
|
|
@@ -1510,10 +1518,12 @@ func RefreshDataFromLt(wg *sync.WaitGroup) (err error) {
|
|
|
//}
|
|
|
resp, err := RefreshEdbData(v.EdbInfoId, v.Source, v.EdbCode, startDate)
|
|
|
if err != nil {
|
|
|
- return errors.New("RefreshEdbData Err:" + err.Error())
|
|
|
+ errMsgList = append(errMsgList,"RefreshEdbData Err:" + err.Error())
|
|
|
+ continue
|
|
|
}
|
|
|
if resp.Ret != 200 {
|
|
|
- return errors.New("RefreshEdbData Err:" + resp.Msg + ";ErrMsg:" + resp.ErrMsg)
|
|
|
+ errMsgList = append(errMsgList,"RefreshEdbData Err:" + resp.Msg + ";ErrMsg:" + resp.ErrMsg)
|
|
|
+ continue
|
|
|
}
|
|
|
//更新指标的最新数据
|
|
|
//item, err := data_manage.GetEdbInfoMaxAndMinInfo(v.Source, v.EdbCode)
|