Skip to content

Commit

Permalink
invalidate clarifcation, remove unified jedis method from ProxyDataMa…
Browse files Browse the repository at this point in the history
…nager
  • Loading branch information
ham1255 committed May 18, 2024
1 parent d6b3956 commit 3314c5e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public abstract class PlayerDataManager<P, LE, DE, PS extends IPubSubMessageEven

public PlayerDataManager(RedisBungeePlugin<P> plugin) {
this.plugin = plugin;
this.unifiedJedis = plugin.proxyDataManager().unifiedJedis();
this.unifiedJedis = plugin.getSummoner().obtainResource();
this.proxyId = plugin.proxyDataManager().proxyId();
this.networkId = plugin.proxyDataManager().networkId();
}
Expand Down Expand Up @@ -83,6 +83,8 @@ protected void handleNetworkPlayerServerChange(IPlayerChangedServerNetworkEvent
}

protected void handleNetworkPlayerQuit(IPlayerLeftNetworkEvent event) {
// reason we don't set the data here because in-case of failure in redis etc,
// events won't reach the proxy so data would be incorrect.
this.proxyCache.invalidate(event.getUuid());
this.serverCache.invalidate(event.getUuid());
this.ipCache.invalidate(event.getUuid());
Expand All @@ -93,6 +95,8 @@ protected void handleNetworkPlayerQuit(IPlayerLeftNetworkEvent event) {
}

protected void handleNetworkPlayerJoin(IPlayerJoinedNetworkEvent event) {
// reason we don't set the data here because in-case of failure in redis etc,
// events won't reach the proxy so data would be incorrect.
this.proxyCache.invalidate(event.getUuid());
this.serverCache.invalidate(event.getUuid());
this.ipCache.invalidate(event.getUuid());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,6 @@ public String proxyId() {
return proxyId;
}

public UnifiedJedis unifiedJedis() {
return unifiedJedis;
}

public String networkId() {
return networkId;
}
Expand Down

0 comments on commit 3314c5e

Please sign in to comment.