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]andwhyour committed 2025-12-22 14:46:15 +00:00
1 parent f043aa62e4
commit 1124040eeb
2 files changed
+14 -2

No files matched your search

+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);