aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/Main.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-07-25 16:49:08 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2016-07-25 16:49:08 +1200
commit451c358879e1f6f2fda26e4b85ef97982fbeaba5 (patch)
tree9b40f2dff6b03b5fb66c29c93dd2fd20cb84b65a /src/org/traccar/Main.java
parent4a31e34ca62d4b1941d3bc329afc127ef7263f34 (diff)
downloadtrackermap-server-451c358879e1f6f2fda26e4b85ef97982fbeaba5.tar.gz
trackermap-server-451c358879e1f6f2fda26e4b85ef97982fbeaba5.tar.bz2
trackermap-server-451c358879e1f6f2fda26e4b85ef97982fbeaba5.zip
Improve history clearing logic
Diffstat (limited to 'src/org/traccar/Main.java')
-rw-r--r--src/org/traccar/Main.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/org/traccar/Main.java b/src/org/traccar/Main.java
index e7e8d8ab9..e992691ad 100644
--- a/src/org/traccar/Main.java
+++ b/src/org/traccar/Main.java
@@ -23,8 +23,8 @@ import java.util.TimerTask;
import java.util.Locale;
public final class Main {
- static final long CLEAN_DELAY = 0;
- static final long CLEAN_PERIOD = 24 * 60 * 60 * 1000;
+
+ private static final long CLEAN_PERIOD = 24 * 60 * 60 * 1000;
private Main() {
}
@@ -40,8 +40,7 @@ public final class Main {
Context.getWebServer().start();
}
- Timer timer = new Timer();
- timer.scheduleAtFixedRate(new TimerTask() {
+ new Timer().scheduleAtFixedRate(new TimerTask() {
@Override
public void run() {
try {
@@ -50,7 +49,7 @@ public final class Main {
Log.warning(error);
}
}
- }, CLEAN_DELAY, CLEAN_PERIOD);
+ }, 0, CLEAN_PERIOD);
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override