diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2020-03-15 16:02:37 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2020-03-15 16:02:37 -0700 |
commit | 606afeb37451f921fe3aecffab439cc2bcc7a175 (patch) | |
tree | cd4337cd546758cf70e66b89d09ef9a5189d5fcc /src/main/java/org/traccar/database/CommandsManager.java | |
parent | 11dcacc2fdfd29f4440c8c46e501ef565f9b1dfd (diff) | |
download | trackermap-server-606afeb37451f921fe3aecffab439cc2bcc7a175.tar.gz trackermap-server-606afeb37451f921fe3aecffab439cc2bcc7a175.tar.bz2 trackermap-server-606afeb37451f921fe3aecffab439cc2bcc7a175.zip |
Queue HTTP commands
Diffstat (limited to 'src/main/java/org/traccar/database/CommandsManager.java')
-rw-r--r-- | src/main/java/org/traccar/database/CommandsManager.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/database/CommandsManager.java b/src/main/java/org/traccar/database/CommandsManager.java index 99114db5e..485402807 100644 --- a/src/main/java/org/traccar/database/CommandsManager.java +++ b/src/main/java/org/traccar/database/CommandsManager.java @@ -76,7 +76,12 @@ public class CommandsManager extends ExtendedObjectManager<Command> { } else { ActiveDevice activeDevice = Context.getConnectionManager().getActiveDevice(deviceId); if (activeDevice != null) { - activeDevice.sendCommand(command); + if (activeDevice.supportsLiveCommands()) { + activeDevice.sendCommand(command); + } else { + getDeviceQueue(deviceId).add(command); + return false; + } } else if (!queueing) { throw new RuntimeException("Device is not online"); } else { |