diff options
author | ninioe <ninioe@gmail.com> | 2016-07-13 15:29:39 +0300 |
---|---|---|
committer | ninioe <ninioe@gmail.com> | 2016-07-13 15:29:39 +0300 |
commit | 0e7cb81693a1067af81b6d74544f16d01fce8b6e (patch) | |
tree | 2c7069e1d124406d86a7abfa02e3cb7bae4fdf37 /src/org/traccar/Main.java | |
parent | d045c1e2174146ddc8ad8b2ef4442863f3d84a11 (diff) | |
download | trackermap-server-0e7cb81693a1067af81b6d74544f16d01fce8b6e.tar.gz trackermap-server-0e7cb81693a1067af81b6d74544f16d01fce8b6e.tar.bz2 trackermap-server-0e7cb81693a1067af81b6d74544f16d01fce8b6e.zip |
changes Anton asked me
Diffstat (limited to 'src/org/traccar/Main.java')
-rw-r--r-- | src/org/traccar/Main.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/org/traccar/Main.java b/src/org/traccar/Main.java index eb3114210..0070904ab 100644 --- a/src/org/traccar/Main.java +++ b/src/org/traccar/Main.java @@ -21,6 +21,8 @@ import java.util.TimerTask; import java.util.Locale; public final class Main { + static final long cleanDelay = 10*1000; //10 sec + static final long cleanPeriod = 24*60*60*1000; //24 hr private Main() { } @@ -36,19 +38,18 @@ 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 + // Clean positions history try { Context.getDataManager().clearPositionsHistory(); } catch (Exception error) { Log.warning(error); } } - }, 10*1000, 24*60*60*1000); + }, cleanDelay, cleanPeriod); Runtime.getRuntime().addShutdownHook(new Thread() { @Override |