Skip to content

Commit

Permalink
adds EOF check
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewpeterkort committed Dec 6, 2023
1 parent 43ab6e5 commit 650fb83
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion extractors/plugin_load.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package extractors
import (
"bufio"
"encoding/json"
"io"
"log"
"os"
"os/exec"
Expand Down Expand Up @@ -52,7 +53,7 @@ func (ml *PluginLoadStep) Start(task task.RuntimeTask) (chan map[string]interfac

for err == nil {
line, isPrefix, err = reader.ReadLine()
if err != nil {
if err != nil && err != io.EOF {
log.Printf("plugin (%s) input error: %s", ml.CommandLine, err)
}
ln = append(ln, line...)
Expand Down
3 changes: 2 additions & 1 deletion transform/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package transform
import (
"bufio"
"encoding/json"
"io"
"log"
"os"
"os/exec"
Expand Down Expand Up @@ -61,7 +62,7 @@ func (ps *pluginProcess) Process(in chan map[string]any, out chan map[string]any

for err == nil {
line, isPrefix, err = reader.ReadLine()
if err != nil {
if err != nil && err != io.EOF {
log.Printf("plugin (%s) input error: %s", ps.config.CommandLine, err)
}
ln = append(ln, line...)
Expand Down

0 comments on commit 650fb83

Please sign in to comment.