From 8550dc61aa70fea96cc73fc57969b8e0c4fab339 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 1 Oct 2015 10:16:58 +1300 Subject: Replace object with system method --- src/org/traccar/database/DataManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/org/traccar/database') diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java index 7bcfeac31..27d03ca08 100644 --- a/src/org/traccar/database/DataManager.java +++ b/src/org/traccar/database/DataManager.java @@ -119,7 +119,7 @@ public class DataManager implements IdentityManager { @Override public Device getDeviceByUniqueId(String uniqueId) throws SQLException { - if ((new Date().getTime() - devicesLastUpdate > devicesRefreshDelay) || !devicesByUniqueId.containsKey(uniqueId)) { + if ((System.currentTimeMillis() - devicesLastUpdate > devicesRefreshDelay) || !devicesByUniqueId.containsKey(uniqueId)) { devicesById.clear(); devicesByUniqueId.clear(); @@ -127,7 +127,7 @@ public class DataManager implements IdentityManager { devicesById.put(device.getId(), device); devicesByUniqueId.put(device.getUniqueId(), device); } - devicesLastUpdate = new Date().getTime(); + devicesLastUpdate = System.currentTimeMillis(); } return devicesByUniqueId.get(uniqueId); -- cgit v1.2.3