Skip to content

Commit

Permalink
fix(worker): fix log on plugin (#3361)
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Coenen <benjamin.coenen@corp.ovh.com>
  • Loading branch information
bnjjj authored and yesnault committed Sep 25, 2018
1 parent b89bab5 commit 7abf470
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions engine/worker/run_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 7abf470

Please sign in to comment.