mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2024-11-22 20:28:00 +00:00
Revert "reintroduce 1 hour cache, remove servers to player cache due changes can happen fast."
This reverts commit e85e18dad8
.
This commit is contained in:
parent
e85e18dad8
commit
70eebdc9ec
@ -37,10 +37,12 @@ import java.util.concurrent.TimeUnit;
|
||||
public abstract class PlayerDataManager<P, LE, DE, PS extends IPubSubMessageEvent, SC extends IPlayerChangedServerNetworkEvent, NJE extends IPlayerLeftNetworkEvent, CE> {
|
||||
|
||||
protected final RedisBungeePlugin<P> plugin;
|
||||
private final LoadingCache<UUID, String> serverCache = Caffeine.newBuilder().expireAfterWrite(1, TimeUnit.HOURS).build(this::getServerFromRedis);
|
||||
private final LoadingCache<UUID, String> lastServerCache = Caffeine.newBuilder().expireAfterWrite(1, TimeUnit.HOURS).build(this::getLastServerFromRedis);
|
||||
private final LoadingCache<UUID, String> proxyCache = Caffeine.newBuilder().expireAfterWrite(1, TimeUnit.HOURS).build(this::getProxyFromRedis);
|
||||
private final LoadingCache<UUID, InetAddress> ipCache = Caffeine.newBuilder().expireAfterWrite(1, TimeUnit.HOURS).build(this::getIpAddressFromRedis);
|
||||
private final LoadingCache<UUID, String> serverCache = Caffeine.newBuilder().expireAfterWrite(1, TimeUnit.MINUTES).build(this::getServerFromRedis);
|
||||
private final LoadingCache<UUID, String> lastServerCache = Caffeine.newBuilder().expireAfterWrite(1, TimeUnit.MINUTES).build(this::getLastServerFromRedis);
|
||||
private final LoadingCache<UUID, String> proxyCache = Caffeine.newBuilder().expireAfterWrite(1, TimeUnit.MINUTES).build(this::getProxyFromRedis);
|
||||
private final LoadingCache<UUID, InetAddress> ipCache = Caffeine.newBuilder().expireAfterWrite(1, TimeUnit.MINUTES).build(this::getIpAddressFromRedis);
|
||||
private final Object SERVERS_TO_PLAYERS_KEY = new Object();
|
||||
private final LoadingCache<Object, Multimap<String, UUID>> serverToPlayersCache = Caffeine.newBuilder().expireAfterWrite(10, TimeUnit.MINUTES).build(this::serversToPlayersBuilder);
|
||||
private final UnifiedJedis unifiedJedis;
|
||||
private final String proxyId;
|
||||
private final String networkId;
|
||||
@ -227,8 +229,11 @@ public abstract class PlayerDataManager<P, LE, DE, PS extends IPubSubMessageEven
|
||||
return getLastOnlineFromRedis(uuid);
|
||||
}
|
||||
|
||||
|
||||
public Multimap<String, UUID> serversToPlayers() {
|
||||
return this.serverToPlayersCache.get(SERVERS_TO_PLAYERS_KEY);
|
||||
}
|
||||
|
||||
protected Multimap<String, UUID> serversToPlayersBuilder(Object o) {
|
||||
try {
|
||||
return new RedisPipelineTask<Multimap<String, UUID>>(plugin) {
|
||||
private final Set<UUID> uuids = plugin.proxyDataManager().networkPlayers();
|
||||
|
Loading…
Reference in New Issue
Block a user