diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-05-12 04:15:50 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-05-12 04:15:50 +1200 |
commit | dd32e2d8d149f1394ac79d5178ad365892e7df76 (patch) | |
tree | 8cd4a15e1de9d875cd490e1ca4af3901266f93ce /src/org/traccar/database | |
parent | b5a311cad65f3be723981e9c338fadc33c20bcf6 (diff) | |
download | traccar-server-dd32e2d8d149f1394ac79d5178ad365892e7df76.tar.gz traccar-server-dd32e2d8d149f1394ac79d5178ad365892e7df76.tar.bz2 traccar-server-dd32e2d8d149f1394ac79d5178ad365892e7df76.zip |
Clear event history (fix #3160)
Diffstat (limited to 'src/org/traccar/database')
-rw-r--r-- | src/org/traccar/database/DataManager.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java index 0c5f458a2..2aeb759f6 100644 --- a/src/org/traccar/database/DataManager.java +++ b/src/org/traccar/database/DataManager.java @@ -308,12 +308,15 @@ public class DataManager { .executeQuery(Position.class); } - public void clearPositionsHistory() throws SQLException { - long historyDays = config.getInteger("database.positionsHistoryDays"); + public void clearHistory() throws SQLException { + long historyDays = config.getInteger("database.historyDays"); if (historyDays != 0) { QueryBuilder.create(dataSource, getQuery("database.deletePositions")) .setDate("serverTime", new Date(System.currentTimeMillis() - historyDays * 24 * 3600 * 1000)) .executeUpdate(); + QueryBuilder.create(dataSource, getQuery("database.deleteEvents")) + .setDate("serverTime", new Date(System.currentTimeMillis() - historyDays * 24 * 3600 * 1000)) + .executeUpdate(); } } |