2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2026-05-03 11:40:29 +00:00

reorganize and do proper resource cleanup

This commit is contained in:
Tux
2016-03-07 20:56:58 -05:00
parent 3fa9b31ad5
commit 88e0aa64a0
6 changed files with 17 additions and 12 deletions

View File

@@ -35,7 +35,6 @@ import java.util.logging.Level;
*/
public class DataManager implements Listener {
private final RedisBungee plugin;
// TODO: Add cleanup for this.
private final Cache<UUID, String> serverCache = createCache();
private final Cache<UUID, String> proxyCache = createCache();
private final Cache<UUID, InetAddress> ipCache = createCache();
@@ -46,6 +45,7 @@ public class DataManager implements Listener {
}
private static <K, V> Cache<K, V> createCache() {
// TODO: Allow customization via cache specification, ala ServerListPlus
return CacheBuilder.newBuilder()
.maximumSize(1000)
.expireAfterWrite(1, TimeUnit.HOURS)