From d045c1e2174146ddc8ad8b2ef4442863f3d84a11 Mon Sep 17 00:00:00 2001 From: ninioe Date: Tue, 12 Jul 2016 16:04:40 +0300 Subject: 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 --- src/org/traccar/Main.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src/org/traccar/Main.java') 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() { -- cgit v1.2.3