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) {
|
public CacheDataSource(DataSource src) {
|
||||||
this.source = src;
|
this.source = src;
|
||||||
this.exec = Executors.newCachedThreadPool();
|
this.exec = Executors.newCachedThreadPool();
|
||||||
cachedAuths = CacheBuilder.newBuilder()
|
this.cachedAuths = CacheBuilder.newBuilder()
|
||||||
.expireAfterWrite(5, TimeUnit.MINUTES)
|
.expireAfterWrite(8, TimeUnit.MINUTES)
|
||||||
.removalListener(RemovalListeners.asynchronous(new RemovalListener<String, Optional<PlayerAuth>>() {
|
.removalListener(new RemovalListener<String, Optional<PlayerAuth>>() {
|
||||||
@Override
|
@Override
|
||||||
public void onRemoval(RemovalNotification<String, Optional<PlayerAuth>> removalNotification) {
|
public void onRemoval(RemovalNotification<String, Optional<PlayerAuth>> removalNotification) {
|
||||||
String name = removalNotification.getKey();
|
String name = removalNotification.getKey();
|
||||||
@ -44,7 +44,7 @@ public class CacheDataSource implements DataSource {
|
|||||||
cachedAuths.getUnchecked(name);
|
cachedAuths.getUnchecked(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, exec))
|
})
|
||||||
.build(
|
.build(
|
||||||
new CacheLoader<String, Optional<PlayerAuth>>() {
|
new CacheLoader<String, Optional<PlayerAuth>>() {
|
||||||
public Optional<PlayerAuth> load(String key) {
|
public Optional<PlayerAuth> load(String key) {
|
||||||
|
Loading…
Reference in New Issue
Block a user