Commit 4fb0ebb2 authored by Tong Li's avatar Tong Li

遗传算法-创建工单

parent c0fba40e
......@@ -34,17 +34,17 @@ public class MachineSchedulerService {
long machineId = machine.getId();
// 尝试从缓存获取
MachineTimeline timeline = timelineCache.get(machineId);
if (timeline != null) {
// 检查有效期(4小时刷新)
if (Duration.between(timeline.getLastUpdated(), LocalDateTime.now()).toHours() < 4) {
return timeline;
}
}
// MachineTimeline timeline = timelineCache.get(machineId);
// if (timeline != null) {
// // 检查有效期(4小时刷新)
// if (Duration.between(timeline.getLastUpdated(), LocalDateTime.now()).toHours() < 4) {
// return timeline;
// }
// }
// 创建新时间线(60天范围)
MachineTimeline newTimeline = generateTimeline(machine);
timelineCache.put(machineId, newTimeline);
// timelineCache.put(machineId, newTimeline);
return newTimeline;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment