mirror of
https://github.com/aljazceru/signal-cli.git
synced 2025-12-19 07:04:21 +01:00
Adapt behavior of receive command as dbus client to match normal mode
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user