Skip to content

Commit

Permalink
Merge pull request TencentBlueKing#9 from liuwenping/master
Browse files Browse the repository at this point in the history
minor: add forwarder before run
  • Loading branch information
liuwenping authored Sep 18, 2021
2 parents 7e94187 + 0339188 commit 1dfbbba
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions filebeat/input/log/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,14 @@ func (h *FileHarvester) AddForwarder(reuseReader *ReuseHarvester) error {
h.state.TTL = h.config.CleanInactive
}

//add forwarder
go func() {h.forwarder <- reuseReader}()

// start to read file
h.runOnce.Do(func() {
go h.Run()
})

//add forwarder
go func() {h.forwarder <- reuseReader}()
return nil
}

Expand Down

0 comments on commit 1dfbbba

Please sign in to comment.