Tighten the "prune peers" interval; move from fixed-rate to fixed-delay scheduling.
This commit is contained in:
parent
7b3ed2dcbf
commit
0a843dc086
|
@ -66,7 +66,7 @@ public class ClientPresenceManager extends RedisClusterPubSubAdapter<String, Str
|
||||||
private final Meter remoteDisplacementMeter;
|
private final Meter remoteDisplacementMeter;
|
||||||
private final Meter pubSubMessageMeter;
|
private final Meter pubSubMessageMeter;
|
||||||
|
|
||||||
private static final int PRUNE_PEERS_INTERVAL_SECONDS = (int)Duration.ofMinutes(3).toSeconds();
|
private static final int PRUNE_PEERS_INTERVAL_SECONDS = (int)Duration.ofSeconds(30).toSeconds();
|
||||||
|
|
||||||
static final String MANAGER_SET_KEY = "presence::managers";
|
static final String MANAGER_SET_KEY = "presence::managers";
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ public class ClientPresenceManager extends RedisClusterPubSubAdapter<String, Str
|
||||||
|
|
||||||
presenceCluster.useCluster(connection -> connection.sync().sadd(MANAGER_SET_KEY, managerId));
|
presenceCluster.useCluster(connection -> connection.sync().sadd(MANAGER_SET_KEY, managerId));
|
||||||
|
|
||||||
pruneMissingPeersFuture = scheduledExecutorService.scheduleAtFixedRate(() -> {
|
pruneMissingPeersFuture = scheduledExecutorService.scheduleWithFixedDelay(() -> {
|
||||||
try {
|
try {
|
||||||
pruneMissingPeers();
|
pruneMissingPeers();
|
||||||
} catch (final Throwable t) {
|
} catch (final Throwable t) {
|
||||||
|
|
Loading…
Reference in New Issue