Skip to content

Commit

Permalink
fix(tools): kill child process on timeout
Browse files Browse the repository at this point in the history
Fix
  • Loading branch information
ElijahReva committed Dec 19, 2023
1 parent 30aa4a8 commit 5d1de2e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion source/Nuke.Tooling/IProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public interface IProcess : IDisposable
/// <summary>
/// Calls <see cref="Process.Kill()"/>.
/// </summary>
void Kill();
void Kill(bool entireProcessTree = false);

/// <summary>
/// Waits for the process to exit. If the process is not exiting within a given timeout, <see cref="Kill"/> is called.
Expand Down
6 changes: 3 additions & 3 deletions source/Nuke.Tooling/Process2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ public void Dispose()
_process.Dispose();
}

public void Kill()
public void Kill(bool entireProcessTree = false)
{
_process.Kill();
_process.Kill(entireProcessTree);
}

public bool WaitForExit()
Expand All @@ -53,7 +53,7 @@ public bool WaitForExit()
// use _process.StartTime
var hasExited = _process.WaitForExit(_timeout ?? -1);
if (!hasExited)
_process.Kill();
_process.Kill(entireProcessTree: true);
return hasExited;
}
}

0 comments on commit 5d1de2e

Please sign in to comment.