From 5cebbfccae29dad81d89591a798d6aa29dd42b75 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 23 Dec 2023 07:02:22 -0800 Subject: Initialize position cache --- src/main/java/org/traccar/session/cache/CacheManager.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/org/traccar/session/cache/CacheManager.java b/src/main/java/org/traccar/session/cache/CacheManager.java index 918c97c66..bb9b4c995 100644 --- a/src/main/java/org/traccar/session/cache/CacheManager.java +++ b/src/main/java/org/traccar/session/cache/CacheManager.java @@ -157,6 +157,10 @@ public class CacheManager implements BroadcastInterface { new Columns.All(), new Condition.Equals("id", deviceId))); graph.addObject(device); initializeCache(device); + if (device.getPositionId() > 0) { + devicePositions.put(deviceId, storage.getObject(Position.class, new Request( + new Columns.All(), new Condition.Equals("id", device.getPositionId())))); + } } } finally { lock.writeLock().unlock(); -- cgit v1.2.3