Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

fix(plugin): do not create bufio scanners continuously while reading the logs #1954

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion plugins/runner/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ func main() {
}
defer logs.Close()

for r := bufio.NewScanner(logs); r.Scan(); {
r := bufio.NewScanner(logs)
for r.Scan() {
fmt.Println("scanner log line: ", r.Text())
}
}()
Expand Down
3 changes: 2 additions & 1 deletion scanner/families/plugins/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ func (s *Scanner) Scan(ctx context.Context, inputType common.InputType, userInpu
}
defer logs.Close()

for r := bufio.NewScanner(logs); r.Scan(); {
r := bufio.NewScanner(logs)
for r.Scan() {
logger.Info(r.Text())
}
}()
Expand Down
Loading