aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/Main.java
diff options
context:
space:
mode:
authorninioe <ninioe@gmail.com>2016-07-12 16:04:40 +0300
committerninioe <ninioe@gmail.com>2016-07-12 16:04:40 +0300
commitd045c1e2174146ddc8ad8b2ef4442863f3d84a11 (patch)
tree458ac9a09ef9df6426a34067072164c44ac18020 /src/org/traccar/Main.java
parent8d5b4ec5ec8e4aaa2c34793e3100a7782551afbd (diff)
downloadtrackermap-server-d045c1e2174146ddc8ad8b2ef4442863f3d84a11.tar.gz
trackermap-server-d045c1e2174146ddc8ad8b2ef4442863f3d84a11.tar.bz2
trackermap-server-d045c1e2174146ddc8ad8b2ef4442863f3d84a11.zip
Added support for Alarm popup & positions history cleaner
1. added support for Alarm and Alarm Type in popup and also in history records. can be muted with a toggle button in the UI 2. added a timer to clear positions history once a day. the default is to save positions history for 7 days if not defined in the configuration file. 3. prevent the lock of the UI files (js, html, css, etc..) for wondows developers in debug mode. It's easier to do changes to the UI without stopping the app each time. 4. tools: added support in test-generator.py to simulate Alert, also added minify.bat file to compile new js files for the UI using sencha SDK for windows developers
Diffstat (limited to 'src/org/traccar/Main.java')
-rw-r--r--src/org/traccar/Main.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/org/traccar/Main.java b/src/org/traccar/Main.java
index 1b8d93e34..eb3114210 100644
--- a/src/org/traccar/Main.java
+++ b/src/org/traccar/Main.java
@@ -16,7 +16,8 @@
package org.traccar;
import org.traccar.helper.Log;
-
+import java.util.Timer;
+import java.util.TimerTask;
import java.util.Locale;
public final class Main {
@@ -35,6 +36,20 @@ public final class Main {
Context.getWebServer().start();
}
+ //added by Erez
+ Timer timer = new Timer();
+ timer.scheduleAtFixedRate(new TimerTask() {
+ @Override
+ public void run() {
+ // Clean positions history every day
+ try {
+ Context.getDataManager().clearPositionsHistory();
+ } catch (Exception error) {
+ Log.warning(error);
+ }
+ }
+ }, 10*1000, 24*60*60*1000);
+
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {