fix noticeinfo bugs
Former-commit-id: 6261719c61eeba3658966a3c90b5b391948ab3c5
This commit is contained in:
parent
8f1fd4af5b
commit
f193d6ab1f
|
@ -333,9 +333,9 @@ func infer(opt *option.InferOption, clusters []*strategy.AssignedCluster, ts []s
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(cs) == successStatusCount {
|
if len(cs) == successStatusCount {
|
||||||
svcCtx.Scheduler.AiStorages.AddNoticeInfo(opt.AdapterId, adapterName, "", "", opt.TaskName, "failed", "任务失败")
|
|
||||||
} else {
|
|
||||||
svcCtx.Scheduler.AiStorages.AddNoticeInfo(opt.AdapterId, adapterName, "", "", opt.TaskName, "completed", "任务完成")
|
svcCtx.Scheduler.AiStorages.AddNoticeInfo(opt.AdapterId, adapterName, "", "", opt.TaskName, "completed", "任务完成")
|
||||||
|
} else {
|
||||||
|
svcCtx.Scheduler.AiStorages.AddNoticeInfo(opt.AdapterId, adapterName, "", "", opt.TaskName, "failed", "任务失败")
|
||||||
}
|
}
|
||||||
|
|
||||||
//save ai sub tasks
|
//save ai sub tasks
|
||||||
|
|
|
@ -311,12 +311,16 @@ func (s *AiStorage) GetStrategyCode(name string) (int64, error) {
|
||||||
func (s *AiStorage) AddNoticeInfo(adapterId string, adapterName string, clusterId string, clusterName string, taskName string, noticeType string, incident string) {
|
func (s *AiStorage) AddNoticeInfo(adapterId string, adapterName string, clusterId string, clusterName string, taskName string, noticeType string, incident string) {
|
||||||
aId, err := strconv.ParseInt(adapterId, 10, 64)
|
aId, err := strconv.ParseInt(adapterId, 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
logx.Errorf("adapterId convert failure, err: %v", err)
|
||||||
}
|
}
|
||||||
cId, err := strconv.ParseInt(clusterId, 10, 64)
|
var cId int64
|
||||||
if err != nil {
|
if clusterId != "" {
|
||||||
return
|
cId, err = strconv.ParseInt(clusterId, 10, 64)
|
||||||
|
if err != nil {
|
||||||
|
logx.Errorf("clusterId convert failure, err: %v", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
noticeInfo := clientCore.NoticeInfo{
|
noticeInfo := clientCore.NoticeInfo{
|
||||||
AdapterId: aId,
|
AdapterId: aId,
|
||||||
AdapterName: adapterName,
|
AdapterName: adapterName,
|
||||||
|
|
Loading…
Reference in New Issue