Thread the cache

This commit is contained in:
Xephi 2015-05-04 16:07:05 +02:00
parent 2968308a8d
commit db27341832
2 changed files with 4 additions and 1 deletions

View File

@ -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);

View File

@ -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