aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/database
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-09-29 17:17:42 -0700
committerAnton Tananaev <anton@traccar.org>2022-09-29 17:17:42 -0700
commit0f74a9c4452a044ff619f0b24d69b41aece09b94 (patch)
tree73409ae843e6cbcd2c231d57d9f71c623aeb986f /src/main/java/org/traccar/database
parent257ee673e08d2d4080d156079ce7b62752f1476d (diff)
downloadtrackermap-server-0f74a9c4452a044ff619f0b24d69b41aece09b94.tar.gz
trackermap-server-0f74a9c4452a044ff619f0b24d69b41aece09b94.tar.bz2
trackermap-server-0f74a9c4452a044ff619f0b24d69b41aece09b94.zip
Remove queueing parameter
Diffstat (limited to 'src/main/java/org/traccar/database')
-rw-r--r--src/main/java/org/traccar/database/CommandsManager.java12
1 files changed, 4 insertions, 8 deletions
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;