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 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) {
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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
|
||||||
###
|
###
|
||||||
|
Loading…
Reference in New Issue
Block a user