aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/Main.java
diff options
context:
space:
mode:
authorninioe <ninioe@gmail.com>2016-07-13 15:29:39 +0300
committerninioe <ninioe@gmail.com>2016-07-13 15:29:39 +0300
commit0e7cb81693a1067af81b6d74544f16d01fce8b6e (patch)
tree2c7069e1d124406d86a7abfa02e3cb7bae4fdf37 /src/org/traccar/Main.java
parentd045c1e2174146ddc8ad8b2ef4442863f3d84a11 (diff)
downloadtrackermap-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.java7
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