aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/handler/events
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-08 07:52:59 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-08 07:52:59 -0700
commitcd229daa23cfc43ad5056c45c4aaecefdbbf826c (patch)
tree4dd8932cda394d20e59143e5e44714695f21c549 /src/main/java/org/traccar/handler/events
parent5890e03199142f041dc19160329a740b4d01450d (diff)
downloadtrackermap-server-cd229daa23cfc43ad5056c45c4aaecefdbbf826c.tar.gz
trackermap-server-cd229daa23cfc43ad5056c45c4aaecefdbbf826c.tar.bz2
trackermap-server-cd229daa23cfc43ad5056c45c4aaecefdbbf826c.zip
Improve cache invalidation
Diffstat (limited to 'src/main/java/org/traccar/handler/events')
-rw-r--r--src/main/java/org/traccar/handler/events/MaintenanceEventHandler.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/handler/events/MaintenanceEventHandler.java b/src/main/java/org/traccar/handler/events/MaintenanceEventHandler.java
index be3e9bf8d..f85aab043 100644
--- a/src/main/java/org/traccar/handler/events/MaintenanceEventHandler.java
+++ b/src/main/java/org/traccar/handler/events/MaintenanceEventHandler.java
@@ -20,6 +20,7 @@ import java.util.HashMap;
import java.util.Map;
import io.netty.channel.ChannelHandler;
+import org.traccar.Context;
import org.traccar.model.Event;
import org.traccar.model.Maintenance;
import org.traccar.model.Position;
@@ -39,7 +40,7 @@ public class MaintenanceEventHandler extends BaseEventHandler {
@Override
protected Map<Event, Position> analyzePosition(Position position) {
- Position lastPosition = cacheManager.getPosition(position.getDeviceId());
+ Position lastPosition = Context.getIdentityManager().getLastPosition(position.getDeviceId());
if (lastPosition == null || position.getFixTime().compareTo(lastPosition.getFixTime()) < 0) {
return null;
}