Revert "Merge pull request #132 from eddc005/feat-pcap"

This reverts commit c453020349, reversing
changes made to 5723490a6c.
This commit is contained in:
Toby
2024-05-07 23:43:54 -07:00
parent 5014523ae0
commit 2ac8783eb6
7 changed files with 10 additions and 184 deletions

View File

@@ -58,17 +58,12 @@ func (e *engine) UpdateRuleset(r ruleset.Ruleset) error {
}
func (e *engine) Run(ctx context.Context) error {
workerCtx, workerCancel := context.WithCancel(ctx)
defer workerCancel() // Stop workers
// Register IO shutdown
ioCtx, ioCancel := context.WithCancel(ctx)
e.io.SetCancelFunc(ioCancel)
defer ioCancel() // Stop IO
defer ioCancel() // Stop workers & IO
// Start workers
for _, w := range e.workers {
go w.Run(workerCtx)
go w.Run(ioCtx)
}
// Register IO callback
@@ -90,8 +85,6 @@ func (e *engine) Run(ctx context.Context) error {
return err
case <-ctx.Done():
return nil
case <-ioCtx.Done():
return nil
}
}