From 3f22a8f47932e7731b69bd85a5523254c4b603d0 Mon Sep 17 00:00:00 2001 From: T00thpick1 Date: Fri, 8 Mar 2013 20:34:38 -0500 Subject: [PATCH] The sleep didn't actually do much of anything.... --- src/main/java/com/gmail/nossr50/config/Config.java | 1 - .../nossr50/database/queuemanager/AsyncQueueManager.java | 5 +---- src/main/java/com/gmail/nossr50/mcMMO.java | 2 +- src/main/resources/config.yml | 1 - 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/gmail/nossr50/config/Config.java b/src/main/java/com/gmail/nossr50/config/Config.java index 367444216..c83e549eb 100644 --- a/src/main/java/com/gmail/nossr50/config/Config.java +++ b/src/main/java/com/gmail/nossr50/config/Config.java @@ -59,7 +59,6 @@ public class Config extends AutoUpdateConfigLoader { public String getMySQLUserName() { return getStringIncludingInts(config, "MySQL.Database.User_Name"); } public int getMySQLServerPort() { return config.getInt("MySQL.Server.Port", 3306); } public String getMySQLServerName() { return config.getString("MySQL.Server.Address", "localhost"); } - public long getQueueThrottle() { return config.getLong("MySQL.QueueThrottle", 100L); } public String getMySQLUserPassword() { if (getStringIncludingInts(config, "MySQL.Database.User_Password") != null) { diff --git a/src/main/java/com/gmail/nossr50/database/queuemanager/AsyncQueueManager.java b/src/main/java/com/gmail/nossr50/database/queuemanager/AsyncQueueManager.java index 231e23540..d24077b1d 100644 --- a/src/main/java/com/gmail/nossr50/database/queuemanager/AsyncQueueManager.java +++ b/src/main/java/com/gmail/nossr50/database/queuemanager/AsyncQueueManager.java @@ -7,12 +7,10 @@ public class AsyncQueueManager implements Runnable { private LinkedBlockingQueue queue; private boolean running; - private long throttle; - public AsyncQueueManager(long throttle) { + public AsyncQueueManager() { this.queue = new LinkedBlockingQueue(); this.running = true; - this.throttle = throttle; } @Override @@ -20,7 +18,6 @@ public class AsyncQueueManager implements Runnable { while(running) { try { queue.take().run(); - Thread.sleep(throttle); } catch (InterruptedException e) { e.printStackTrace(); } diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index 347b64db2..b594942c8 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -459,7 +459,7 @@ public class mcMMO extends JavaPlugin { scheduler.scheduleSyncRepeatingTask(this, new BleedTimerTask(), 40, 40); if (Config.getInstance().getUseMySQL()) { - queueManager = new AsyncQueueManager(Config.getInstance().getQueueThrottle()); + queueManager = new AsyncQueueManager(); scheduler.runTaskAsynchronously(this, queueManager); } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 563ff2b1b..c6326227a 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -48,7 +48,6 @@ MySQL: Server: Port: 3306 Address: localhost - QueueThrottle: 100L # # Settings for Hardcore mode ###