aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/database/ConnectionManager.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-10-18 14:32:51 -0700
committerGitHub <noreply@github.com>2020-10-18 14:32:51 -0700
commit0d5dd20257ab5a4c77ff628b67e6d54931d8ae16 (patch)
tree9c5be8d286ef0f2244329d60385e9e8f1fef6fbd /src/main/java/org/traccar/database/ConnectionManager.java
parenta9f5599a1ae18279339a7ff17058d40b9ed4fab4 (diff)
parent3ad889413e4b13d2dd6a2aa6454964dd9427fb28 (diff)
downloadtrackermap-server-0d5dd20257ab5a4c77ff628b67e6d54931d8ae16.tar.gz
trackermap-server-0d5dd20257ab5a4c77ff628b67e6d54931d8ae16.tar.bz2
trackermap-server-0d5dd20257ab5a4c77ff628b67e6d54931d8ae16.zip
Merge pull request #4584 from kamaci/master
Anonymous types are replaced with lambda
Diffstat (limited to 'src/main/java/org/traccar/database/ConnectionManager.java')
-rw-r--r--src/main/java/org/traccar/database/ConnectionManager.java10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/main/java/org/traccar/database/ConnectionManager.java b/src/main/java/org/traccar/database/ConnectionManager.java
index 4d43bc71b..9342fd3de 100644
--- a/src/main/java/org/traccar/database/ConnectionManager.java
+++ b/src/main/java/org/traccar/database/ConnectionManager.java
@@ -17,7 +17,6 @@ package org.traccar.database;
import io.netty.channel.Channel;
import io.netty.util.Timeout;
-import io.netty.util.TimerTask;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.traccar.Context;
@@ -122,12 +121,9 @@ public class ConnectionManager {
}
if (status.equals(Device.STATUS_ONLINE)) {
- timeouts.put(deviceId, GlobalTimer.getTimer().newTimeout(new TimerTask() {
- @Override
- public void run(Timeout timeout) {
- if (!timeout.isCancelled()) {
- updateDevice(deviceId, Device.STATUS_UNKNOWN, null);
- }
+ timeouts.put(deviceId, GlobalTimer.getTimer().newTimeout(timeout1 -> {
+ if (!timeout1.isCancelled()) {
+ updateDevice(deviceId, Device.STATUS_UNKNOWN, null);
}
}, deviceTimeout, TimeUnit.MILLISECONDS));
}