The sleep didn't actually do much of anything....

This commit is contained in:
T00thpick1 2013-03-08 20:34:38 -05:00 committed by NuclearW
parent aeae60f968
commit 3f22a8f479
4 changed files with 2 additions and 7 deletions

View File

@ -59,7 +59,6 @@ public class Config extends AutoUpdateConfigLoader {
public String getMySQLUserName() { return getStringIncludingInts(config, "MySQL.Database.User_Name"); } public String getMySQLUserName() { return getStringIncludingInts(config, "MySQL.Database.User_Name"); }
public int getMySQLServerPort() { return config.getInt("MySQL.Server.Port", 3306); } public int getMySQLServerPort() { return config.getInt("MySQL.Server.Port", 3306); }
public String getMySQLServerName() { return config.getString("MySQL.Server.Address", "localhost"); } public String getMySQLServerName() { return config.getString("MySQL.Server.Address", "localhost"); }
public long getQueueThrottle() { return config.getLong("MySQL.QueueThrottle", 100L); }
public String getMySQLUserPassword() { public String getMySQLUserPassword() {
if (getStringIncludingInts(config, "MySQL.Database.User_Password") != null) { if (getStringIncludingInts(config, "MySQL.Database.User_Password") != null) {

View File

@ -7,12 +7,10 @@ public class AsyncQueueManager implements Runnable {
private LinkedBlockingQueue<Queueable> queue; private LinkedBlockingQueue<Queueable> queue;
private boolean running; private boolean running;
private long throttle;
public AsyncQueueManager(long throttle) { public AsyncQueueManager() {
this.queue = new LinkedBlockingQueue<Queueable>(); this.queue = new LinkedBlockingQueue<Queueable>();
this.running = true; this.running = true;
this.throttle = throttle;
} }
@Override @Override
@ -20,7 +18,6 @@ public class AsyncQueueManager implements Runnable {
while(running) { while(running) {
try { try {
queue.take().run(); queue.take().run();
Thread.sleep(throttle);
} catch (InterruptedException e) { } catch (InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -459,7 +459,7 @@ public class mcMMO extends JavaPlugin {
scheduler.scheduleSyncRepeatingTask(this, new BleedTimerTask(), 40, 40); scheduler.scheduleSyncRepeatingTask(this, new BleedTimerTask(), 40, 40);
if (Config.getInstance().getUseMySQL()) { if (Config.getInstance().getUseMySQL()) {
queueManager = new AsyncQueueManager(Config.getInstance().getQueueThrottle()); queueManager = new AsyncQueueManager();
scheduler.runTaskAsynchronously(this, queueManager); scheduler.runTaskAsynchronously(this, queueManager);
} }

View File

@ -48,7 +48,6 @@ MySQL:
Server: Server:
Port: 3306 Port: 3306
Address: localhost Address: localhost
QueueThrottle: 100L
# #
# Settings for Hardcore mode # Settings for Hardcore mode
### ###