diff --git a/application/state/useReportAutoScheduler.ts b/application/state/useReportAutoScheduler.ts index 2787e46..c1a3411 100644 --- a/application/state/useReportAutoScheduler.ts +++ b/application/state/useReportAutoScheduler.ts @@ -178,14 +178,12 @@ export function useReportAutoScheduler() { const tick = useCallback(async () => { if (runningRef.current) return; const cfg = scheduleRef.current; - // 临时验证:忽略 enabled 检查 - // if (!cfg?.enabled) return; + if (!cfg?.enabled) return; if (cfg.enabledDeviceIds && cfg.enabledDeviceIds.length === 0) return; - const intervalMs = 2 * 60 * 1000; // 临时验证:强制 2 分钟 + const intervalMs = (cfg.defaultIntervalHours || 1) * 3600 * 1000; const now = Date.now(); - // 临时验证:首次立即执行,不等快照时间 if (lastRunAtRef.current !== 0 && now - lastRunAtRef.current < intervalMs) return; runningRef.current = true;