Only handle jsonRpc requests, after receive thread has caught up with old messages

This commit is contained in:
AsamK 2021-09-04 15:06:25 +02:00
parent ac18006abb
commit 5a2e37a6e2
2 changed files with 29 additions and 5 deletions

View file

@ -75,6 +75,16 @@ public class JsonRpcDispatcherCommand implements LocalCommand {
objectMapper.valueToTree(s),
null)), m, ignoreAttachments);
// Maybe this should be handled inside the Manager
while (!m.hasCaughtUpWithOldMessages()) {
try {
synchronized (m) {
m.wait();
}
} catch (InterruptedException ignored) {
}
}
final BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
final var jsonRpcReader = new JsonRpcReader(jsonRpcSender, () -> {