Catch exceptions thrown while pruning missing peers.

This commit is contained in:
Jon Chambers 2020-10-19 11:08:16 -04:00 committed by Jon Chambers
parent 42ed6c3ded
commit 7b3ed2dcbf
1 changed files with 7 additions and 1 deletions

View File

@ -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