Catch exceptions thrown while pruning missing peers.

This commit is contained in:
Jon Chambers authored and Jon Chambers committed 2020-10-20 19:00:55 -04:00
1 parent 42ed6c3ded
commit 7b3ed2dcbf
1 file changed
+7 -1
@@ -115,7 +115,13 @@ public class ClientPresenceManager extends RedisClusterPubSubAdapter<String, Str
presenceCluster.useCluster(connection -> connection.sync().sadd(MANAGER_SET_KEY, managerId));
pruneMissingPeersFuture = scheduledExecutorService.scheduleAtFixedRate(this::pruneMissingPeers, new Random().nextInt(PRUNE_PEERS_INTERVAL_SECONDS), PRUNE_PEERS_INTERVAL_SECONDS, TimeUnit.SECONDS);
pruneMissingPeersFuture = scheduledExecutorService.scheduleAtFixedRate(() -> {
try {
pruneMissingPeers();
} catch (final Throwable t) {
log.warn("Failed to prune missing peers", t);
}
}, new Random().nextInt(PRUNE_PEERS_INTERVAL_SECONDS), PRUNE_PEERS_INTERVAL_SECONDS, TimeUnit.SECONDS);
}
@Override