Skip to content

Commit

Permalink
oops: remove cache of last-online
Browse files Browse the repository at this point in the history
i must forgotten to remove it during development
  • Loading branch information
ham1255 committed May 7, 2024
1 parent e6b7892 commit f8c304d
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public abstract class PlayerDataManager<P, LE, DE, PS extends IPubSubMessageEven
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, Long> lastOnlineCache = Caffeine.newBuilder().expireAfterWrite(1, TimeUnit.HOURS).build(this::getLastOnlineFromRedis);
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;
Expand Down Expand Up @@ -80,7 +79,6 @@ protected void handleNetworkPlayerQuit(IPlayerLeftNetworkEvent event) {
this.proxyCache.invalidate(event.getUuid());
this.serverCache.invalidate(event.getUuid());
this.ipCache.invalidate(event.getUuid());
this.lastOnlineCache.invalidate(event.getUuid());
}

protected void handlePubSubMessageEvent(IPubSubMessageEvent event) {
Expand Down Expand Up @@ -228,7 +226,7 @@ public InetAddress getIpFor(UUID uuid) {
}

public long getLastOnline(UUID uuid) {
return this.lastOnlineCache.get(uuid);
return getLastOnlineFromRedis(uuid);
}

public Multimap<String, UUID> serversToPlayers() {
Expand Down

0 comments on commit f8c304d

Please sign in to comment.