Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Simulator agent: exit schedule if the recurrence schedule has already ended (#2218)

Koen1ce3239da48d
diff --git a/agent/src/main/java/org/openremote/agent/protocol/simulator/SimulatorProtocol.java b/agent/src/main/java/org/openremote/agent/protocol/simulator/SimulatorProtocol.java
index c7c3cf3e8..51b12bb8b 100644
--- a/agent/src/main/java/org/openremote/agent/protocol/simulator/SimulatorProtocol.java
+++ b/agent/src/main/java/org/openremote/agent/protocol/simulator/SimulatorProtocol.java
@@ -199,7 +199,7 @@ public class SimulatorProtocol extends AbstractProtocol<SimulatorAgent, Simulato
}
OptionalLong nextRun = getDelay(nextDatapoint.timestamp, timeSinceOccurrenceStarted, schedule.orElse(null));
- if (nextRun.isEmpty()) {
+ if (nextRun.isEmpty() || nextRun.getAsLong() < 0) {
LOG.warning("Replay schedule has ended for: " + attributeRef);
return null;
}