refactor: Update smart factory log scheduling behavior
- Removed immediate plan generation on server start to prevent sending logs for past timestamps. - Updated the upsertSchedule response message to clarify that the schedule will take effect from the next day at 00:05. These changes aim to enhance the reliability of the smart factory log scheduling system by ensuring that logs are sent at the correct times and reducing the risk of sending outdated logs.
This commit is contained in:
@@ -9,7 +9,6 @@ import { encryptionService } from "../services/encryptionService";
|
||||
import {
|
||||
sendSmartFactoryLog,
|
||||
getTodayPlanStatus,
|
||||
planDailySends,
|
||||
} from "../utils/smartFactoryLog";
|
||||
|
||||
/**
|
||||
@@ -278,10 +277,8 @@ export const upsertSchedule = async (
|
||||
]
|
||||
);
|
||||
|
||||
// 스케줄 변경 시 오늘 계획 재생성
|
||||
await planDailySends();
|
||||
|
||||
res.json({ success: true, message: "스케줄이 저장되었습니다." });
|
||||
// 계획은 매일 00:05에만 생성 (즉시 재생성하면 지난 시각 소급 전송 위험)
|
||||
res.json({ success: true, message: "스케줄이 저장되었습니다. 내일 00:05부터 적용됩니다." });
|
||||
} catch (error) {
|
||||
logger.error("스케줄 저장 실패:", error);
|
||||
res.status(500).json({ success: false, message: "스케줄 저장 실패" });
|
||||
|
||||
Reference in New Issue
Block a user