From 7abf470bb9e8ed7ebc8147e09eb0cce97ccb5a3e Mon Sep 17 00:00:00 2001 From: Coenen Benjamin Date: Tue, 25 Sep 2018 17:20:16 +0200 Subject: [PATCH] fix(worker): fix log on plugin (#3361) Signed-off-by: Benjamin Coenen --- engine/worker/run_plugin.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/engine/worker/run_plugin.go b/engine/worker/run_plugin.go index f49ebc450e..d728aefdcf 100644 --- a/engine/worker/run_plugin.go +++ b/engine/worker/run_plugin.go @@ -31,14 +31,16 @@ type pluginClientSocket struct { func enablePluginLogger(ctx context.Context, sendLog LoggerFunc, c *pluginClientSocket) { var accumulator string var shouldExit bool + defer func() { + if accumulator != "" { + sendLog(accumulator) + } + }() for { if ctx.Err() != nil { shouldExit = true } - defer func() { - sendLog(accumulator) - }() b, err := c.BuffOut.ReadByte() if err == io.EOF {