Skip to content

Commit

Permalink
fix(agent): 🐛 ensure sensor workers can remain running when running h…
Browse files Browse the repository at this point in the history
…eadless
  • Loading branch information
joshuar committed Jun 13, 2024
1 parent 57876e4 commit 4fd534b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/agent/runners.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,19 @@ func runWorkers(ctx context.Context, trk SensorTracker, reg sensor.Registry) {
}
}()

var wg sync.WaitGroup

wg.Add(1)

go func() {
defer wg.Done()
<-ctx.Done()

for _, c := range cancelFuncs {
c()
}
}()
wg.Wait()
}

// runScripts will retrieve all scripts that the agent can run and queue them up
Expand Down

0 comments on commit 4fd534b

Please sign in to comment.