Skip to content

Commit

Permalink
add wg to startPoller to ensure globTicker.Stop() is called during sh…
Browse files Browse the repository at this point in the history
…utdown
  • Loading branch information
jsirianni committed Aug 17, 2021
1 parent 5cd08a9 commit 9ce72a1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions operator/builtin/input/journald/journald.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ func (operator *JournaldInput) Start() error {
func (operator *JournaldInput) startPoller(ctx context.Context) {
go func() {
globTicker := time.NewTicker(operator.pollInterval)
operator.wg.Add(1)

defer operator.wg.Done()
defer globTicker.Stop()

for {
Expand Down

0 comments on commit 9ce72a1

Please sign in to comment.