mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-12-20 07:37:47 +01:00
parent
05aec0f4fe
commit
c9b884624d
@ -34,9 +34,9 @@ public class CacheDataSource implements DataSource {
|
||||
public CacheDataSource(DataSource src) {
|
||||
this.source = src;
|
||||
this.exec = Executors.newCachedThreadPool();
|
||||
cachedAuths = CacheBuilder.newBuilder()
|
||||
.expireAfterWrite(5, TimeUnit.MINUTES)
|
||||
.removalListener(RemovalListeners.asynchronous(new RemovalListener<String, Optional<PlayerAuth>>() {
|
||||
this.cachedAuths = CacheBuilder.newBuilder()
|
||||
.expireAfterWrite(8, TimeUnit.MINUTES)
|
||||
.removalListener(new RemovalListener<String, Optional<PlayerAuth>>() {
|
||||
@Override
|
||||
public void onRemoval(RemovalNotification<String, Optional<PlayerAuth>> removalNotification) {
|
||||
String name = removalNotification.getKey();
|
||||
@ -44,7 +44,7 @@ public class CacheDataSource implements DataSource {
|
||||
cachedAuths.getUnchecked(name);
|
||||
}
|
||||
}
|
||||
}, exec))
|
||||
})
|
||||
.build(
|
||||
new CacheLoader<String, Optional<PlayerAuth>>() {
|
||||
public Optional<PlayerAuth> load(String key) {
|
||||
|
Loading…
Reference in New Issue
Block a user