fix log bugs

Former-commit-id: 92a183cafaea2973d5d0fe5c868537c9cd69e4b2
This commit is contained in:
tzwang 2024-05-11 19:25:33 +08:00
parent 8ccb51cab0
commit e12f80725e
3 changed files with 6 additions and 2 deletions

View File

@ -92,7 +92,7 @@ func (l *GetCenterTaskListLogic) updateAiTaskStatus(mu *sync.RWMutex, ch chan<-
}
for _, task := range taskList {
t := task
if t.Status == constants.Completed {
if t.Status == constants.Completed || t.JobId == "" {
continue
}
wg.Add(1)

View File

@ -197,7 +197,7 @@ func (as *AiScheduler) AssignTask(clusters []*strategy.AssignedCluster) (interfa
return nil, errors.New("database add failed: " + err.Error())
}
}
for s := range ch {
for _, s := range results {
if s.Msg != "" {
msg := fmt.Sprintf("clusterId: %v , error: %v \n", s.ClusterId, s.Msg)
errmsg += msg

View File

@ -471,6 +471,10 @@ func (o *OctopusLink) GetTrainingTaskLog(ctx context.Context, taskId string, ins
return "", err
}
if strings.Contains(resp.Content, "404 Not Found") {
resp.Content = "waiting for logs..."
}
return resp.Content, nil
}