Skip to content

Commit

Permalink
Increment WaitGroup while cleaning-up old files
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Swartz committed Dec 27, 2024
1 parent a62cd85 commit e2a36a1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/component/pyroscope/java/loop.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ func newProfilingLoop(pid int, target discovery.Target, logger log.Logger, profi
return p
}

p.wg.Add(1)
go func() {
defer p.wg.Done()
// Clean-up files that weren't removed up by a previous instance of alloy
err := p.cleanupOldJFRFiles(jfrFileName)
if err != nil {
Expand Down

0 comments on commit e2a36a1

Please sign in to comment.