diff options
author | Jacob Vosmaer (GitLab) <jacob@gitlab.com> | 2017-12-15 18:16:23 +0300 |
---|---|---|
committer | Ahmad Sherif <ahmad.m.sherif@gmail.com> | 2017-12-15 18:16:23 +0300 |
commit | 832f32e14702fa513fdb0b8b25785287d034f85c (patch) | |
tree | 9bd26fbcd300f1360a47458869962cc09a595275 /internal/supervisor | |
parent | fd572dbc74f7386da09848f4bb393905d75d49f7 (diff) |
Eagerly close logrus writer pipes
Diffstat (limited to 'internal/supervisor')
-rw-r--r-- | internal/supervisor/supervisor.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/internal/supervisor/supervisor.go b/internal/supervisor/supervisor.go index eba248549..2df305cc1 100644 --- a/internal/supervisor/supervisor.go +++ b/internal/supervisor/supervisor.go @@ -2,6 +2,7 @@ package supervisor import ( "fmt" + "io" "os/exec" "sync" "time" @@ -141,6 +142,9 @@ spawnLoop: go func(cmd *exec.Cmd, waitCh chan struct{}) { err := cmd.Wait() close(waitCh) + + cmd.Stdout.(io.WriteCloser).Close() + cmd.Stderr.(io.WriteCloser).Close() logger.WithError(err).Warn("exited") }(cmd, waitCh) |