mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2025-02-23 07:11:30 +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) {
|
||||
database = new CacheDataSource(this, database);
|
||||
if (database instanceof CacheDataSource)
|
||||
((CacheDataSource)database).start();
|
||||
}
|
||||
|
||||
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.PlayerCache;
|
||||
|
||||
public class CacheDataSource implements DataSource {
|
||||
public class CacheDataSource extends Thread implements DataSource {
|
||||
|
||||
private DataSource source;
|
||||
public AuthMe plugin;
|
||||
@ -135,6 +135,7 @@ public class CacheDataSource implements DataSource {
|
||||
@Override
|
||||
public synchronized void close() {
|
||||
source.close();
|
||||
this.interrupt();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user