mirror of
https://github.com/whyour/qinglong.git
synced 2025-12-23 15:50:07 +08:00
Address code review feedback - improve null checks
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
This commit is contained in:
parent
1124040eeb
commit
a56f2393a4
|
|
@ -398,8 +398,8 @@ export function psTree(pid: number): Promise<number[]> {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isPidRunning(pid: number): boolean {
|
export function isPidRunning(pid: number): boolean {
|
||||||
// Validate PID is a positive integer
|
// Validate PID: must be a positive integer
|
||||||
if (!pid || pid <= 0 || !Number.isInteger(pid)) {
|
if (pid == null || pid <= 0 || !Number.isInteger(pid)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,9 @@ export default async () => {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// 收集需要重置的任务 ID
|
// 收集需要重置的任务 ID
|
||||||
idsToReset.push(cron.id!);
|
if (cron.id) {
|
||||||
|
idsToReset.push(cron.id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 批量更新所有需要重置的任务
|
// 批量更新所有需要重置的任务
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user