aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/org/traccar/DefaultDataHandler.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/org/traccar/DefaultDataHandler.java b/src/org/traccar/DefaultDataHandler.java
index d75b62dee..cb35baceb 100644
--- a/src/org/traccar/DefaultDataHandler.java
+++ b/src/org/traccar/DefaultDataHandler.java
@@ -25,7 +25,10 @@ public class DefaultDataHandler extends BaseDataHandler {
try {
Context.getDataManager().addPosition(position);
- Context.getDataManager().updateLatestPosition(position);
+ Position lastPosition = Context.getConnectionManager().getLastPosition(position.getDeviceId());
+ if (position.getFixTime().compareTo(lastPosition.getFixTime()) > 0) {
+ Context.getDataManager().updateLatestPosition(position);
+ }
} catch (Exception error) {
Log.warning(error);
}