diff options
Diffstat (limited to 'src/main/java/org/traccar/database')
-rw-r--r-- | src/main/java/org/traccar/database/ConnectionManager.java | 10 |
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)); } |