Support missing config options

This commit is contained in:
Govindass 2021-02-07 17:20:00 +02:00
parent 1ad3813c73
commit 7227496c1c
2 changed files with 2 additions and 2 deletions

View File

@ -51,7 +51,7 @@ public class EffExecuteStatement extends Effect {
static String lastError;
private static final ExecutorService threadPool =
Executors.newFixedThreadPool(SkriptDB.getInstance().getConfig().getInt("thread-pool-size"));
Executors.newFixedThreadPool(SkriptDB.getInstance().getConfig().getInt("thread-pool-size", 2));
private Expression<String> query;
private Expression<HikariDataSource> dataSource;

View File

@ -59,7 +59,7 @@ public class ExprDataSource extends SimpleExpression<HikariDataSource> {
HikariDataSource ds = new HikariDataSource();
//allow specifying of own sql driver class name
if (!SkriptDB.getInstance().getConfig().getString("sql-driver-class-name").equals("default")) {
if (!SkriptDB.getInstance().getConfig().getString("sql-driver-class-name", "default").equals("default")) {
ds.setDriverClassName(SkriptDB.getInstance().getConfig().getString("sql-driver-class-name"));
}
ds.setJdbcUrl(jdbcUrl);