Skip to content

Commit 53e2401

Browse files
sguiheuxbnjjj
authored andcommitted
fix (api): fetch tempURL (#1775)
1 parent f12a30d commit 53e2401

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

engine/api/workflow_run.go

+10-6
Original file line numberDiff line numberDiff line change
@@ -814,14 +814,18 @@ func (api *API) getWorkflowRunArtifactsHandler() Handler {
814814
return runs[i].SubNumber > runs[j].SubNumber
815815
})
816816

817+
wg := &sync.WaitGroup{}
817818
for i := range runs[0].Artifacts {
818-
a := &runs[0].Artifacts[i]
819-
url, _ := objectstore.FetchTempURL(a)
820-
if url != "" {
821-
a.TempURL = url
822-
}
819+
wg.Add(1)
820+
go func(a *sdk.WorkflowNodeRunArtifact) {
821+
defer wg.Done()
822+
url, _ := objectstore.FetchTempURL(a)
823+
if url != "" {
824+
a.TempURL = url
825+
}
826+
}(&runs[0].Artifacts[i])
823827
}
824-
828+
wg.Wait()
825829
arts = append(arts, runs[0].Artifacts...)
826830
}
827831

0 commit comments

Comments
 (0)