Optimize PID validation and use bulk database update

Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-22 14:46:15 +00:00
co-authored by whyour
parent f043aa62e4
commit 1124040eeb
2 changed files with 14 additions and 2 deletions
+5
View File
@@ -398,6 +398,11 @@ export function psTree(pid: number): Promise<number[]> {
}
export function isPidRunning(pid: number): boolean {
// Validate PID is a positive integer
if (!pid || pid <= 0 || !Number.isInteger(pid)) {
return false;
}
try {
// Signal 0 doesn't kill the process, just checks if it exists
process.kill(pid, 0);