aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/MainEventHandler.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-09 06:39:10 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-09 06:39:10 -0700
commitc4ff983ffe9a03a57d3ab0596abe8bce08c1ae2e (patch)
tree0cb36557ca3cbad928099edb37e7a8d2101b4f19 /src/main/java/org/traccar/MainEventHandler.java
parent65d3654dcca878cfd839e40c0dd020da199be09e (diff)
downloadtrackermap-server-c4ff983ffe9a03a57d3ab0596abe8bce08c1ae2e.tar.gz
trackermap-server-c4ff983ffe9a03a57d3ab0596abe8bce08c1ae2e.tar.bz2
trackermap-server-c4ff983ffe9a03a57d3ab0596abe8bce08c1ae2e.zip
Add position cache
Diffstat (limited to 'src/main/java/org/traccar/MainEventHandler.java')
-rw-r--r--src/main/java/org/traccar/MainEventHandler.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/MainEventHandler.java b/src/main/java/org/traccar/MainEventHandler.java
index f04307fdb..bb84a09d2 100644
--- a/src/main/java/org/traccar/MainEventHandler.java
+++ b/src/main/java/org/traccar/MainEventHandler.java
@@ -28,6 +28,7 @@ import org.traccar.database.StatisticsManager;
import org.traccar.helper.DateUtil;
import org.traccar.helper.NetworkUtil;
import org.traccar.model.Position;
+import org.traccar.session.cache.CacheManager;
import org.traccar.storage.StorageException;
import javax.inject.Inject;
@@ -60,6 +61,7 @@ public class MainEventHandler extends ChannelInboundHandlerAdapter {
Position position = (Position) msg;
try {
Context.getDeviceManager().updateLatestPosition(position);
+ Main.getInjector().getInstance(CacheManager.class).updatePosition(position);
} catch (StorageException error) {
LOGGER.warn("Failed to update device", error);
}