Reduce the number of entries sent to the verbose viewer, cleanup old hikari try..catches

This commit is contained in:
Luck 2018-03-03 20:41:46 +00:00
parent f93e8fdccd
commit 0d89840179
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
3 changed files with 11 additions and 14 deletions

View File

@ -88,17 +88,9 @@ public abstract class HikariConnectionFactory extends AbstractConnectionFactory
// If a connection is not returned within 10 seconds, it's probably safe to assume it's been leaked.
config.setLeakDetectionThreshold(TimeUnit.SECONDS.toMillis(10)); // 10000
// The drivers are really old in some of the older Spigot binaries, so Connection#isValid doesn't work.
config.setConnectionTestQuery("/* LuckPerms ping */ SELECT 1");
try {
// don't perform any initial connection validation - we subsequently call #getConnection
// to setup the schema anyways
config.setInitializationFailTimeout(-1);
} catch (NoSuchMethodError e) {
//noinspection deprecation
config.setInitializationFailFast(false);
}
// don't perform any initial connection validation - we subsequently call #getConnection
// to setup the schema anyways
config.setInitializationFailTimeout(-1);
this.hikari = new HikariDataSource(config);
}

View File

@ -127,7 +127,12 @@ public class CheckData {
public JsonObject toJson(StackTracePrinter tracePrinter) {
return formBaseJson()
.add("trace", new JArray()
.consume(arr -> tracePrinter.process(this.checkTrace, StackTracePrinter.elementToString(arr::add)))
.consume(arr -> {
int overflow = tracePrinter.process(this.checkTrace, StackTracePrinter.elementToString(arr::add));
if (overflow != 0) {
arr.add("... and " + overflow + " more");
}
})
)
.toJson();
}

View File

@ -56,11 +56,11 @@ public class VerboseListener {
private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z");
// how much data should we store before stopping.
private static final int DATA_TRUNCATION = 10000;
private static final int DATA_TRUNCATION = 3000;
// how many lines should we include in each stack trace send as a chat message
private static final int STACK_TRUNCATION_CHAT = 15;
// how many lines should we include in each stack trace in the web output
private static final int STACK_TRUNCATION_WEB = 30;
private static final int STACK_TRUNCATION_WEB = 20;
private static final StackTracePrinter FILTERING_PRINTER = StackTracePrinter.builder()
.ignoreClassStartingWith("me.lucko.luckperms.")