forked from LogBlock/LogBlock
Merge pull request #325 from DarkArc/configWarningQueueSize
Allow the queue size warning to be configurable
This commit is contained in:
@@ -260,8 +260,10 @@ public class Consumer extends TimerTask
|
|||||||
return;
|
return;
|
||||||
final Connection conn = logblock.getConnection();
|
final Connection conn = logblock.getConnection();
|
||||||
Statement state = null;
|
Statement state = null;
|
||||||
if (getQueueSize() > 1000)
|
if (Config.queueWarningSize > 0 && queue.size() >= Config.queueWarningSize) {
|
||||||
getLogger().info("[Consumer] Queue overloaded. Size: " + getQueueSize());
|
getLogger().info("[Consumer] Queue overloaded. Size: " + getQueueSize());
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (conn == null)
|
if (conn == null)
|
||||||
return;
|
return;
|
||||||
|
@@ -26,6 +26,7 @@ public class Config
|
|||||||
public static int delayBetweenRuns, forceToProcessAtLeast, timePerRun;
|
public static int delayBetweenRuns, forceToProcessAtLeast, timePerRun;
|
||||||
public static boolean fireCustomEvents;
|
public static boolean fireCustomEvents;
|
||||||
public static boolean useBukkitScheduler;
|
public static boolean useBukkitScheduler;
|
||||||
|
public static int queueWarningSize;
|
||||||
public static boolean enableAutoClearLog;
|
public static boolean enableAutoClearLog;
|
||||||
public static List<String> autoClearLog;
|
public static List<String> autoClearLog;
|
||||||
public static int autoClearLogDelay;
|
public static int autoClearLogDelay;
|
||||||
@@ -73,6 +74,7 @@ public class Config
|
|||||||
def.put("consumer.timePerRun", 1000);
|
def.put("consumer.timePerRun", 1000);
|
||||||
def.put("consumer.fireCustomEvents", false);
|
def.put("consumer.fireCustomEvents", false);
|
||||||
def.put("consumer.useBukkitScheduler", true);
|
def.put("consumer.useBukkitScheduler", true);
|
||||||
|
def.put("consumer.queueWarningSize", 1000);
|
||||||
def.put("clearlog.dumpDeletedLog", false);
|
def.put("clearlog.dumpDeletedLog", false);
|
||||||
def.put("clearlog.enableAutoClearLog", false);
|
def.put("clearlog.enableAutoClearLog", false);
|
||||||
def.put("clearlog.auto", Arrays.asList("world \"world\" before 365 days all", "world \"world\" player lavaflow waterflow leavesdecay before 7 days all", "world world_nether before 365 days all", "world world_nether player lavaflow before 7 days all"));
|
def.put("clearlog.auto", Arrays.asList("world \"world\" before 365 days all", "world \"world\" player lavaflow waterflow leavesdecay before 7 days all", "world world_nether before 365 days all", "world world_nether player lavaflow before 7 days all"));
|
||||||
@@ -133,6 +135,7 @@ public class Config
|
|||||||
timePerRun = config.getInt("consumer.timePerRun", 1000);
|
timePerRun = config.getInt("consumer.timePerRun", 1000);
|
||||||
fireCustomEvents = config.getBoolean("consumer.fireCustomEvents", false);
|
fireCustomEvents = config.getBoolean("consumer.fireCustomEvents", false);
|
||||||
useBukkitScheduler = config.getBoolean("consumer.useBukkitScheduler", true);
|
useBukkitScheduler = config.getBoolean("consumer.useBukkitScheduler", true);
|
||||||
|
queueWarningSize = config.getInt("consumer.queueWarningSize", 1000);
|
||||||
enableAutoClearLog = config.getBoolean("clearlog.enableAutoClearLog");
|
enableAutoClearLog = config.getBoolean("clearlog.enableAutoClearLog");
|
||||||
autoClearLog = config.getStringList("clearlog.auto");
|
autoClearLog = config.getStringList("clearlog.auto");
|
||||||
dumpDeletedLog = config.getBoolean("clearlog.dumpDeletedLog", false);
|
dumpDeletedLog = config.getBoolean("clearlog.dumpDeletedLog", false);
|
||||||
|
Reference in New Issue
Block a user