mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-29 16:46:46 +01:00
The sleep didn't actually do much of anything....
This commit is contained in:
parent
aeae60f968
commit
3f22a8f479
@ -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) {
|
||||
|
@ -7,12 +7,10 @@ public class AsyncQueueManager implements Runnable {
|
||||
|
||||
private LinkedBlockingQueue<Queueable> queue;
|
||||
private boolean running;
|
||||
private long throttle;
|
||||
|
||||
public AsyncQueueManager(long throttle) {
|
||||
public AsyncQueueManager() {
|
||||
this.queue = new LinkedBlockingQueue<Queueable>();
|
||||
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();
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,6 @@ MySQL:
|
||||
Server:
|
||||
Port: 3306
|
||||
Address: localhost
|
||||
QueueThrottle: 100L
|
||||
#
|
||||
# Settings for Hardcore mode
|
||||
###
|
||||
|
Loading…
Reference in New Issue
Block a user