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 {