mirror of
https://github.com/whyour/qinglong.git
synced 2025-12-23 07:32:40 +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 {
|
||||
// Validate PID is a positive integer
|
||||
if (!pid || pid <= 0 || !Number.isInteger(pid)) {
|
||||
// Validate PID: must be a positive integer
|
||||
if (pid == null || pid <= 0 || !Number.isInteger(pid)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -143,7 +143,9 @@ export default async () => {
|
|||
continue;
|
||||
}
|
||||
// 收集需要重置的任务 ID
|
||||
idsToReset.push(cron.id!);
|
||||
if (cron.id) {
|
||||
idsToReset.push(cron.id);
|
||||
}
|
||||
}
|
||||
|
||||
// 批量更新所有需要重置的任务
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user