diff options
author | ninioe <ninioe@gmail.com> | 2016-08-01 16:12:47 +0300 |
---|---|---|
committer | ninioe <ninioe@gmail.com> | 2016-08-01 16:12:47 +0300 |
commit | 94781fa3ba35e494e309aee19a5e15c14d3193c1 (patch) | |
tree | a1e4a90e9a2fce3db8bc51981aeb8a23cced5e6d /src/org/traccar/MainEventHandler.java | |
parent | b4841fa0a6293c0b895cf6bb65c6c2d871c78397 (diff) | |
parent | e177e7d083a4dd3f64172802661bf658d26d1163 (diff) | |
download | trackermap-server-94781fa3ba35e494e309aee19a5e15c14d3193c1.tar.gz trackermap-server-94781fa3ba35e494e309aee19a5e15c14d3193c1.tar.bz2 trackermap-server-94781fa3ba35e494e309aee19a5e15c14d3193c1.zip |
Merge remote-tracking branch 'refs/remotes/tananaev/master'
Diffstat (limited to 'src/org/traccar/MainEventHandler.java')
-rw-r--r-- | src/org/traccar/MainEventHandler.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/org/traccar/MainEventHandler.java b/src/org/traccar/MainEventHandler.java index 771009aca..c01760283 100644 --- a/src/org/traccar/MainEventHandler.java +++ b/src/org/traccar/MainEventHandler.java @@ -26,6 +26,7 @@ import org.jboss.netty.handler.timeout.IdleStateEvent; import org.traccar.helper.Log; import org.traccar.model.Position; +import java.sql.SQLException; import java.text.SimpleDateFormat; public class MainEventHandler extends IdleStateAwareChannelHandler { @@ -36,6 +37,11 @@ public class MainEventHandler extends IdleStateAwareChannelHandler { if (e.getMessage() != null && e.getMessage() instanceof Position) { Position position = (Position) e.getMessage(); + try { + Context.getDeviceManager().updateLatestPosition(position); + } catch (SQLException error) { + Log.warning(error); + } String uniqueId = Context.getIdentityManager().getDeviceById(position.getDeviceId()).getUniqueId(); @@ -54,6 +60,7 @@ public class MainEventHandler extends IdleStateAwareChannelHandler { s.append(", result: ").append(cmdResult); } Log.info(s.toString()); + } } |