aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-09-29 17:23:16 -0700
committerAnton Tananaev <anton@traccar.org>2022-09-29 17:23:16 -0700
commit7246644f393f9a373f4e3f2be846500e8456a286 (patch)
treebf68bd19cb29cb1e675d0034821b707d364076c7
parent0f74a9c4452a044ff619f0b24d69b41aece09b94 (diff)
downloadtrackermap-server-7246644f393f9a373f4e3f2be846500e8456a286.tar.gz
trackermap-server-7246644f393f9a373f4e3f2be846500e8456a286.tar.bz2
trackermap-server-7246644f393f9a373f4e3f2be846500e8456a286.zip
Simplify commands logic
-rw-r--r--src/main/java/org/traccar/database/CommandsManager.java9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/main/java/org/traccar/database/CommandsManager.java b/src/main/java/org/traccar/database/CommandsManager.java
index 49eda79b2..945fb13af 100644
--- a/src/main/java/org/traccar/database/CommandsManager.java
+++ b/src/main/java/org/traccar/database/CommandsManager.java
@@ -83,13 +83,8 @@ public class CommandsManager {
}
} else {
DeviceSession deviceSession = connectionManager.getDeviceSession(deviceId);
- if (deviceSession != null) {
- if (deviceSession.supportsLiveCommands()) {
- deviceSession.sendCommand(command);
- } else {
- getDeviceQueue(deviceId).add(command);
- return false;
- }
+ if (deviceSession != null && deviceSession.supportsLiveCommands()) {
+ deviceSession.sendCommand(command);
} else {
getDeviceQueue(deviceId).add(command);
return false;