aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/MainEventHandler.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-07-25 23:53:44 +1200
committerGitHub <noreply@github.com>2016-07-25 23:53:44 +1200
commit7e20896334f4f6927cf14c5272cf7d893efc3a05 (patch)
tree4ce04313dde4989a4c5b16816ddfeab1a6381876 /src/org/traccar/MainEventHandler.java
parent8c4eb2eff9da9bf0538e413444c1e6dae981b99e (diff)
parent80847cc39a0570a91618c2d9da283767a99fd975 (diff)
downloadtrackermap-server-7e20896334f4f6927cf14c5272cf7d893efc3a05.tar.gz
trackermap-server-7e20896334f4f6927cf14c5272cf7d893efc3a05.tar.bz2
trackermap-server-7e20896334f4f6927cf14c5272cf7d893efc3a05.zip
Merge pull request #2149 from Abyss777/lastposition_reorganization
Move lastPosition update to the end of pipeline
Diffstat (limited to 'src/org/traccar/MainEventHandler.java')
-rw-r--r--src/org/traccar/MainEventHandler.java7
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());
+
}
}