aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/MainEventHandler.java
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-07-25 08:59:36 +0500
committerAbyss777 <abyss@fox5.ru>2016-07-25 08:59:36 +0500
commitf6333c73fe8bdd0027bb16a715193e1587b934a2 (patch)
tree340e9f66b9c3891665a0284e4a3ca8c813d87827 /src/org/traccar/MainEventHandler.java
parent866c3073ef48a24d86834a391a4d3d91209a6eed (diff)
downloadtrackermap-server-f6333c73fe8bdd0027bb16a715193e1587b934a2.tar.gz
trackermap-server-f6333c73fe8bdd0027bb16a715193e1587b934a2.tar.bz2
trackermap-server-f6333c73fe8bdd0027bb16a715193e1587b934a2.zip
- Move lastPosition update to the end of pipeline
- Optimize MotionEventHandler to do not use Device.motion - Remove Device.motion from model and database - some optimizations
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());
+
}
}