Adapt behavior of receive command as dbus client to match normal mode

This commit is contained in:
AsamK 2021-10-24 19:16:35 +02:00
parent 004293362e
commit 9b102c49d0

View file

@ -128,11 +128,18 @@ public class ReceiveCommand implements ExtendedDbusCommand, LocalCommand {
logger.error("Dbus client failed", e); logger.error("Dbus client failed", e);
throw new UnexpectedErrorException("Dbus client failed", e); throw new UnexpectedErrorException("Dbus client failed", e);
} }
double timeout = ns.getDouble("timeout");
long timeoutMilliseconds = timeout < 0 ? 10000 : (long) (timeout * 1000);
while (true) { while (true) {
try { try {
Thread.sleep(10000); Thread.sleep(timeoutMilliseconds);
} catch (InterruptedException ignored) { } catch (InterruptedException ignored) {
return; break;
}
if (timeout >= 0) {
break;
} }
} }
} }