Skip to content

Commit

Permalink
runners: try not to eat up the stack
Browse files Browse the repository at this point in the history
  • Loading branch information
USA-RedDragon committed Feb 20, 2024
1 parent e3f3e02 commit 91997c9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion internal/olsrd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ func run(ctx context.Context, stopChan chan struct{}) {
} else {
fmt.Println("OLSR process exited, restarting it")
}
run(ctx, stopChan)
err = olsrCmd.Process.Signal(os.Signal(syscall.SIGKILL))
if err != nil {
log.Printf("failed to kill process: %v\n", err)
}
go run(ctx, stopChan)
case <-ctx.Done():
err = <-processResults
if err != nil {
Expand Down
6 changes: 5 additions & 1 deletion internal/vtun/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ func run(ctx context.Context, stopChan chan struct{}) {
} else {
fmt.Println("VTun process exited, restarting it")
}
run(ctx, stopChan)
err = vtunCmd.Process.Signal(os.Signal(syscall.SIGKILL))
if err != nil {
log.Printf("failed to kill process: %v\n", err)
}
go run(ctx, stopChan)
case <-ctx.Done():
err = <-processResults
if err != nil {
Expand Down

0 comments on commit 91997c9

Please sign in to comment.