Add database setting to configure HikariCP 'maxLifetime' #1279
This commit is contained in:
@@ -10,7 +10,7 @@ import static ch.jalu.configme.properties.PropertyInitializer.newProperty;
|
||||
public final class DatabaseSettings implements SettingsHolder {
|
||||
|
||||
@Comment({"What type of database do you want to use?",
|
||||
"Valid values: SQLITE, MYSQL"})
|
||||
"Valid values: SQLITE, MYSQL"})
|
||||
public static final Property<DataSourceType> BACKEND =
|
||||
newProperty(DataSourceType.class, "DataSource.backend", DataSourceType.SQLITE);
|
||||
|
||||
@@ -114,6 +114,11 @@ public final class DatabaseSettings implements SettingsHolder {
|
||||
public static final Property<Integer> MYSQL_POOL_SIZE =
|
||||
newProperty("DataSource.poolSize", -1);
|
||||
|
||||
@Comment({"The maximum lifetime of a connection in the pool, default = 1800 seconds",
|
||||
"You should set this at least 30 seconds less than mysql server wait_timeout"})
|
||||
public static final Property<Integer> MYSQL_CONNECTION_MAX_LIFETIME =
|
||||
newProperty("DataSource.maxLifetime", 1800);
|
||||
|
||||
private DatabaseSettings() {
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user