mirror of
https://github.com/whyour/qinglong.git
synced 2026-08-13 20:30:48 +08:00
Address code review feedback - improve null checks
Co-authored-by: whyour <22700758+whyour@users.noreply.github.com>
This commit is contained in:
co-authored by
whyour
parent
1124040eeb
commit
a56f2393a4
+2
-2
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
// 批量更新所有需要重置的任务
|
||||
|
||||
Reference in New Issue
Block a user