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

遗传算法-创建工单

parent c0fba40e
...@@ -34,17 +34,17 @@ public class MachineSchedulerService { ...@@ -34,17 +34,17 @@ public class MachineSchedulerService {
long machineId = machine.getId(); long machineId = machine.getId();
// 尝试从缓存获取 // 尝试从缓存获取
MachineTimeline timeline = timelineCache.get(machineId); // MachineTimeline timeline = timelineCache.get(machineId);
if (timeline != null) { // if (timeline != null) {
// 检查有效期(4小时刷新) // // 检查有效期(4小时刷新)
if (Duration.between(timeline.getLastUpdated(), LocalDateTime.now()).toHours() < 4) { // if (Duration.between(timeline.getLastUpdated(), LocalDateTime.now()).toHours() < 4) {
return timeline; // return timeline;
} // }
} // }
// 创建新时间线(60天范围) // 创建新时间线(60天范围)
MachineTimeline newTimeline = generateTimeline(machine); MachineTimeline newTimeline = generateTimeline(machine);
timelineCache.put(machineId, newTimeline); // timelineCache.put(machineId, newTimeline);
return 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