mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Adapt behavior of receive command as dbus client to match normal mode
This commit is contained in:
parent
004293362e
commit
9b102c49d0
1 changed files with 9 additions and 2 deletions
|
@ -128,11 +128,18 @@ public class ReceiveCommand implements ExtendedDbusCommand, LocalCommand {
|
|||
logger.error("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) {
|
||||
try {
|
||||
Thread.sleep(10000);
|
||||
Thread.sleep(timeoutMilliseconds);
|
||||
} catch (InterruptedException ignored) {
|
||||
return;
|
||||
break;
|
||||
}
|
||||
if (timeout >= 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue