1
0
mirror of https://github.com/go-task/task.git synced 2025-08-08 22:36:57 +02:00

feat: merge concurrency

This commit is contained in:
Pete Davison
2024-03-19 19:04:56 +00:00
parent e9448bd4be
commit 3efb437c9a

View File

@@ -70,10 +70,8 @@ func (tfg *TaskfileGraph) Merge() (*Taskfile, error) {
// Loop over edge that leads to a vertex that includes the current vertex
for _, edge := range predecessorMap[hash] {
// TODO: Enable goroutines
// Start a goroutine to process each included Taskfile
// g.Go(
err := func() error {
g.Go(func() error {
// Get the base vertex
vertex, err := tfg.Vertex(edge.Source)
if err != nil {
@@ -95,11 +93,10 @@ func (tfg *TaskfileGraph) Merge() (*Taskfile, error) {
}
return nil
}()
if err != nil {
})
if err := g.Wait(); err != nil {
return nil, err
}
// )
}
// Wait for all the go routines to finish