diff options
author | Anton Tananaev <anton@traccar.org> | 2022-09-29 17:17:42 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-09-29 17:17:42 -0700 |
commit | 0f74a9c4452a044ff619f0b24d69b41aece09b94 (patch) | |
tree | 73409ae843e6cbcd2c231d57d9f71c623aeb986f /src/main/java/org/traccar | |
parent | 257ee673e08d2d4080d156079ce7b62752f1476d (diff) | |
download | trackermap-server-0f74a9c4452a044ff619f0b24d69b41aece09b94.tar.gz trackermap-server-0f74a9c4452a044ff619f0b24d69b41aece09b94.tar.bz2 trackermap-server-0f74a9c4452a044ff619f0b24d69b41aece09b94.zip |
Remove queueing parameter
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r-- | src/main/java/org/traccar/config/Keys.java | 8 | ||||
-rw-r--r-- | src/main/java/org/traccar/database/CommandsManager.java | 12 |
2 files changed, 4 insertions, 16 deletions
diff --git a/src/main/java/org/traccar/config/Keys.java b/src/main/java/org/traccar/config/Keys.java index ea394d914..1da01518c 100644 --- a/src/main/java/org/traccar/config/Keys.java +++ b/src/main/java/org/traccar/config/Keys.java @@ -780,14 +780,6 @@ public final class Keys { List.of(KeyType.CONFIG)); /** - * Enable commands queuing when devices are offline. Commands are buffered in memory only, so restarting service - * will clear the buffer. - */ - public static final ConfigKey<Boolean> COMMANDS_QUEUEING = new BooleanConfigKey( - "commands.queueing", - List.of(KeyType.CONFIG)); - - /** * Root folder for all template files. */ public static final ConfigKey<String> TEMPLATES_ROOT = new StringConfigKey( diff --git a/src/main/java/org/traccar/database/CommandsManager.java b/src/main/java/org/traccar/database/CommandsManager.java index 2967b8abd..49eda79b2 100644 --- a/src/main/java/org/traccar/database/CommandsManager.java +++ b/src/main/java/org/traccar/database/CommandsManager.java @@ -18,8 +18,6 @@ package org.traccar.database; import org.traccar.BaseProtocol; import org.traccar.ServerManager; -import org.traccar.config.Config; -import org.traccar.config.Keys; import org.traccar.model.Command; import org.traccar.model.Device; import org.traccar.model.Position; @@ -55,22 +53,22 @@ public class CommandsManager { private final SmsManager smsManager; private final ConnectionManager connectionManager; - private final boolean queueing; - @Inject public CommandsManager( Storage storage, ServerManager serverManager, @Nullable SmsManager smsManager, - ConnectionManager connectionManager, Config config) { + ConnectionManager connectionManager) { this.storage = storage; this.serverManager = serverManager; this.smsManager = smsManager; this.connectionManager = connectionManager; - queueing = config.getBoolean(Keys.COMMANDS_QUEUEING); } public boolean sendCommand(Command command) throws Exception { long deviceId = command.getDeviceId(); if (command.getTextChannel()) { + if (smsManager == null) { + throw new RuntimeException("SMS not configured"); + } Device device = storage.getObject(Device.class, new Request( new Columns.Include("positionId", "phone"), new Condition.Equals("id", "id", deviceId))); Position position = storage.getObject(Position.class, new Request( @@ -92,8 +90,6 @@ public class CommandsManager { getDeviceQueue(deviceId).add(command); return false; } - } else if (!queueing) { - throw new RuntimeException("Device is not online"); } else { getDeviceQueue(deviceId).add(command); return false; |