Skip to content

Commit

Permalink
(#25) Optimise reading for docker-compose output
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelapenya committed Apr 16, 2020
1 parent 661033b commit 88efbd0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"path/filepath"
"runtime"
"strings"
"sync"

"gopkg.in/yaml.v2"
)
Expand Down Expand Up @@ -172,13 +173,16 @@ func execute(
}
}

var wg sync.WaitGroup
wg.Add(1)

go func() {
_, errStdout = io.Copy(stdout, stdoutIn)
wg.Done()
}()

go func() {
_, errStderr = io.Copy(stderr, stderrIn)
}()
_, errStderr = io.Copy(stderr, stderrIn)
wg.Wait()

err = cmd.Wait()

Expand Down

0 comments on commit 88efbd0

Please sign in to comment.