9
0
mirror of https://github.com/WiIIiam278/HuskSync.git synced 2026-01-06 15:41:56 +00:00

fix: cache not cleared on /userdata delete, close #245

This commit is contained in:
William278
2024-02-13 14:38:19 +00:00
parent 19636d9447
commit 131a364f53
2 changed files with 14 additions and 1 deletions

View File

@@ -255,6 +255,18 @@ public class RedisManager extends JedisPubSub {
}
}
@Blocking
public void clearUserData(@NotNull User user) {
try (Jedis jedis = jedisPool.getResource()) {
jedis.del(
getKey(RedisKeyType.LATEST_SNAPSHOT, user.getUuid(), clusterId)
);
plugin.debug(String.format("[%s] Cleared %s on Redis", user.getUsername(), RedisKeyType.LATEST_SNAPSHOT));
} catch (Throwable e) {
plugin.log(Level.SEVERE, "An exception occurred clearing user data on Redis", e);
}
}
@Blocking
public void setUserCheckedOut(@NotNull User user, boolean checkedOut) {
try (Jedis jedis = jedisPool.getResource()) {