Skip to content

Commit

Permalink
fix: lint issue (keploy#1774)
Browse files Browse the repository at this point in the history
Signed-off-by: gouravkrosx <[email protected]>
  • Loading branch information
gouravkrosx authored Apr 2, 2024
1 parent f625961 commit 48ec8ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/core/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ func (a *App) run(ctx context.Context) models.AppError {
// Set the cancel function for the command
cmd.Cancel = func() error {

return utils.InterruptProcessTree(cmd, a.logger, cmd.Process.Pid, syscall.SIGINT)
return utils.InterruptProcessTree(a.logger, cmd.Process.Pid, syscall.SIGINT)
}
// wait after sending the interrupt signal, before sending the kill signal
cmd.WaitDelay = 10 * time.Second
Expand Down
4 changes: 2 additions & 2 deletions utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ func RunInDocker(ctx context.Context, logger *zap.Logger) error {
)

cmd.Cancel = func() error {
return InterruptProcessTree(cmd, logger, cmd.Process.Pid, syscall.SIGINT)
return InterruptProcessTree(logger, cmd.Process.Pid, syscall.SIGINT)
}

cmd.Stdout = os.Stdout
Expand Down Expand Up @@ -533,7 +533,7 @@ func SentryInit(logger *zap.Logger, dsn string) {
//}

// InterruptProcessTree interrupts an entire process tree using the given signal
func InterruptProcessTree(cmd *exec.Cmd, logger *zap.Logger, ppid int, sig syscall.Signal) error {
func InterruptProcessTree(logger *zap.Logger, ppid int, sig syscall.Signal) error {
// Find all descendant PIDs of the given PID & then signal them.
// Any shell doesn't signal its children when it receives a signal.
// Children may have their own process groups, so we need to signal them separately.
Expand Down

0 comments on commit 48ec8ba

Please sign in to comment.