aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/handler
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/traccar/handler')
-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;
}