mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2025-02-22 23:01:28 +01:00
Thread the cache
This commit is contained in:
parent
2968308a8d
commit
db27341832
@ -232,6 +232,8 @@ public class AuthMe extends JavaPlugin {
|
|||||||
|
|
||||||
if (Settings.isCachingEnabled) {
|
if (Settings.isCachingEnabled) {
|
||||||
database = new CacheDataSource(this, database);
|
database = new CacheDataSource(this, database);
|
||||||
|
if (database instanceof CacheDataSource)
|
||||||
|
((CacheDataSource)database).start();
|
||||||
}
|
}
|
||||||
|
|
||||||
dataManager = new DataManager(this, database);
|
dataManager = new DataManager(this, database);
|
||||||
|
@ -9,7 +9,7 @@ import fr.xephi.authme.AuthMe;
|
|||||||
import fr.xephi.authme.cache.auth.PlayerAuth;
|
import fr.xephi.authme.cache.auth.PlayerAuth;
|
||||||
import fr.xephi.authme.cache.auth.PlayerCache;
|
import fr.xephi.authme.cache.auth.PlayerCache;
|
||||||
|
|
||||||
public class CacheDataSource implements DataSource {
|
public class CacheDataSource extends Thread implements DataSource {
|
||||||
|
|
||||||
private DataSource source;
|
private DataSource source;
|
||||||
public AuthMe plugin;
|
public AuthMe plugin;
|
||||||
@ -135,6 +135,7 @@ public class CacheDataSource implements DataSource {
|
|||||||
@Override
|
@Override
|
||||||
public synchronized void close() {
|
public synchronized void close() {
|
||||||
source.close();
|
source.close();
|
||||||
|
this.interrupt();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user