burn less cpu when we aren't connected to anyone

This commit is contained in:
2024-06-29 23:26:04 +02:00
parent b21d1361cb
commit 1c03457545

View File

@@ -112,7 +112,9 @@ public class InvalidationQueueService {
public void pushInvalidationToAll(String name, boolean shouldNotifySeen) {
synchronized (this) {
for (var h : remoteHostManager.getSeenHosts()) {
var hosts = remoteHostManager.getSeenHosts();
if (hosts.isEmpty()) return;
for (var h : hosts) {
getSetForHost(h).add(Pair.of(name, shouldNotifySeen));
}
this.notifyAll();