From 3b2d2db5ffcba874455ba42bbd015eb2caa4cc05 Mon Sep 17 00:00:00 2001 From: zaunist Date: Thu, 22 May 2025 22:22:57 +0800 Subject: [PATCH] fix: compatible with old xugou_agent --- backend/src/jobs/agent-task.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/jobs/agent-task.ts b/backend/src/jobs/agent-task.ts index 9ce5e13..f638e96 100644 --- a/backend/src/jobs/agent-task.ts +++ b/backend/src/jobs/agent-task.ts @@ -41,7 +41,7 @@ export const checkAgentsStatus = async (c: any) => { const timeDiff = now.getTime() - lastUpdateTime.getTime(); // 如果超过5个监控周期没有更新状态,将客户端状态设置为inactive - if (timeDiff > (parseInt(agent.keepalive) * 5 * 1000)) { + if (timeDiff > (parseInt(agent.keepalive || "60") * 5 * 1000)) { console.log( `定时任务: 客户端 ${agent.name} (ID: ${agent.id}) 超过5个监控周期未更新状态,设置为离线` );