diff options
Diffstat (limited to 'src/org/traccar/model/DatabaseDataManager.java')
-rw-r--r-- | src/org/traccar/model/DatabaseDataManager.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/org/traccar/model/DatabaseDataManager.java b/src/org/traccar/model/DatabaseDataManager.java index 7521828a3..f17839594 100644 --- a/src/org/traccar/model/DatabaseDataManager.java +++ b/src/org/traccar/model/DatabaseDataManager.java @@ -171,8 +171,9 @@ public class DatabaseDataManager implements DataManager { public Device getDeviceByImei(String imei) throws SQLException { if ((devices == null) || (Calendar.getInstance().getTimeInMillis() - devicesLastUpdate.getTimeInMillis() > devicesRefreshDelay)) { + List<Device> list = getDevices(); devices = new HashMap<String, Device>(); - for (Device device: getDevices()) { + for (Device device: list) { devices.put(device.getImei(), device); } devicesLastUpdate = Calendar.getInstance(); |