From 8ae7a85bf8191acd44f31769ab9bbe01a2892b8a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 22 Dec 2025 14:50:12 +0000 Subject: [PATCH] Use consistent null checking pattern for PID validation Co-authored-by: whyour <22700758+whyour@users.noreply.github.com> --- back/loaders/initData.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/back/loaders/initData.ts b/back/loaders/initData.ts index c9d87c74..b3407eb6 100644 --- a/back/loaders/initData.ts +++ b/back/loaders/initData.ts @@ -138,7 +138,7 @@ export default async () => { for (const cron of allCrons) { // 如果任务有 PID 且进程仍在运行,则保持其状态 - if (cron.pid && isPidRunning(cron.pid)) { + if (cron.pid != null && isPidRunning(cron.pid)) { // 保留当前状态(running 或 queued) continue; }