Skip to content

Commit

Permalink
Merge pull request #86 from trickest/fix/output-splitter-children
Browse files Browse the repository at this point in the history
Fix spliter children output download
  • Loading branch information
mhmdiaa authored May 18, 2023
2 parents 3a889d6 + c908a78 commit ca41821
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/output/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func DownloadRunOutput(run *types.Run, nodes map[string]NodeInfo, files []string
}

func getSubJobOutput(savePath string, subJob *types.SubJob, files []string, fetchData bool) []types.SubJobOutput {
if subJob.OutputsStatus != "FINALIZED" && !subJob.TaskGroup {
if subJob.Status != "SUCCEEDED" {
return nil
}

Expand All @@ -322,7 +322,7 @@ func getSubJobOutput(savePath string, subJob *types.SubJob, files []string, fetc
return nil
}

if subJob.TaskGroup {
if subJob.OutputsStatus == "NO_OUTPUTS" && subJob.Status == "SUCCEEDED" {
savePath = path.Join(savePath, subJob.Label)
dirInfo, err := os.Stat(savePath)
dirExists := !os.IsNotExist(err) && dirInfo.IsDir()
Expand All @@ -336,11 +336,11 @@ func getSubJobOutput(savePath string, subJob *types.SubJob, files []string, fetc
}

children := getChildrenSubJobs(subJob.ID)
if children == nil || len(children) == 0 {
if children == nil {
return nil
}
for j := range children {
children[j].Label = children[j].TaskIndex + "-" + subJob.Label
children[j].Label = fmt.Sprint(j) + "-" + subJob.Label
}

subJob.Children = make([]types.SubJob, 0)
Expand Down

0 comments on commit ca41821

Please sign in to comment.