Skip to content

Commit 15c40fa

Browse files
committed
Enable use of DisableStdioBuffer
Previously, DisableStdioBuffer was added in #16, however was not consumed or used, as reported in #19. DisableStdioBuffer can now be set, if you only want to stream directly to stdio, or want to capture the output to your own writer without buffering. Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
1 parent 3c8da2f commit 15c40fa

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

exec.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,10 @@ func (et ExecTask) Execute(ctx context.Context) (ExecResult, error) {
151151
var stdoutWriters []io.Writer
152152
var stderrWriters []io.Writer
153153

154-
// Always capture to a buffer
155-
stdoutWriters = append(stdoutWriters, &stdoutBuff)
156-
stderrWriters = append(stderrWriters, &stderrBuff)
154+
if !et.DisableStdioBuffer {
155+
stdoutWriters = append(stdoutWriters, &stdoutBuff)
156+
stderrWriters = append(stderrWriters, &stderrBuff)
157+
}
157158

158159
if et.StreamStdio {
159160
stdoutWriters = append(stdoutWriters, os.Stdout)

0 commit comments

Comments
 (0)