diff options
-rw-r--r-- | src/org/traccar/Context.java | 3 | ||||
-rw-r--r-- | src/org/traccar/database/DataCache.java | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/org/traccar/Context.java b/src/org/traccar/Context.java index 13a3b33c4..058b60150 100644 --- a/src/org/traccar/Context.java +++ b/src/org/traccar/Context.java @@ -90,7 +90,7 @@ public class Context { } dataManager = new DataManager(properties); - dataCache = new DataCache(dataManager); + dataCache = new DataCache(); if (Boolean.valueOf(properties.getProperty("web.new"))) { permissionsManager = new PermissionsManager(); } @@ -113,6 +113,7 @@ public class Context { serverManager = new ServerManager(); dataManager.initDatabaseSchema(); + dataCache.init(dataManager); serverManager.init(); } diff --git a/src/org/traccar/database/DataCache.java b/src/org/traccar/database/DataCache.java index 390187200..fc29f0e2e 100644 --- a/src/org/traccar/database/DataCache.java +++ b/src/org/traccar/database/DataCache.java @@ -23,9 +23,7 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Set; - import org.traccar.helper.Log; -import org.traccar.model.Event; import org.traccar.model.Position; public class DataCache { @@ -33,7 +31,7 @@ public class DataCache { private final Map<Long, Position> positions = new HashMap<Long, Position>(); private final Map<Long, Set<DataCacheListener>> listeners = new HashMap<Long, Set<DataCacheListener>>(); - public DataCache(DataManager dataManager) { + public void init(DataManager dataManager) { try { Collection<Position> positions = dataManager.getLatestPositions(); for (Position position : positions) { |