Skip to content

Commit aab5b8f

Browse files
committed
[executor] Drop stdout messages if no piping selected
1 parent 49d585b commit aab5b8f

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

executor/executable/controllabletask.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929
"encoding/json"
3030
"errors"
3131
"io"
32+
"io/ioutil"
3233
"reflect"
3334
"strings"
3435
"syscall"
@@ -146,6 +147,13 @@ func (t *ControllableTask) Launch() error {
146147
WithField("task", t.ti.Name).
147148
WriterLevel(logrus.WarnLevel), stderrIn)
148149
}()
150+
default:
151+
go func() {
152+
_, errStdout = io.Copy(ioutil.Discard, stdoutIn)
153+
}()
154+
go func() {
155+
_, errStderr = io.Copy(ioutil.Discard, stderrIn)
156+
}()
149157
}
150158

151159
log.WithFields(logrus.Fields{

0 commit comments

Comments
 (0)