mirror of
https://github.com/AuthMe/AuthMeReloaded.git
synced 2024-11-09 12:10:56 +01:00
Add option to override dbcp size
This commit is contained in:
parent
627b9dd5c5
commit
1867617dbb
@ -40,6 +40,7 @@ public class MySQL implements DataSource {
|
||||
private String password;
|
||||
private String database;
|
||||
private String tableName;
|
||||
private int poolSize;
|
||||
private List<String> columnOthers;
|
||||
private Columns col;
|
||||
private HashAlgorithm hashAlgorithm;
|
||||
@ -98,6 +99,10 @@ public class MySQL implements DataSource {
|
||||
this.phpBbPrefix = settings.getProperty(HooksSettings.PHPBB_TABLE_PREFIX);
|
||||
this.phpBbGroup = settings.getProperty(HooksSettings.PHPBB_ACTIVATED_GROUP_ID);
|
||||
this.wordpressPrefix = settings.getProperty(HooksSettings.WORDPRESS_TABLE_PREFIX);
|
||||
this.poolSize = settings.getProperty(DatabaseSettings.MYSQL_POOL_SIZE);
|
||||
if(poolSize == -1) {
|
||||
poolSize = RuntimeUtils.getCoreCount();
|
||||
}
|
||||
}
|
||||
|
||||
private void setConnectionArguments() throws RuntimeException {
|
||||
@ -105,7 +110,7 @@ public class MySQL implements DataSource {
|
||||
ds.setPoolName("AuthMeMYSQLPool");
|
||||
|
||||
// Pool size
|
||||
ds.setMaximumPoolSize(RuntimeUtils.getCoreCount());
|
||||
ds.setMaximumPoolSize(poolSize);
|
||||
|
||||
// Database URL
|
||||
ds.setJdbcUrl("jdbc:mysql://" + this.host + ":" + this.port + "/" + this.database);
|
||||
|
@ -98,6 +98,10 @@ public class DatabaseSettings implements SettingsHolder {
|
||||
public static final Property<String> MYSQL_COL_GROUP =
|
||||
newProperty("ExternalBoardOptions.mySQLColumnGroup", "");
|
||||
|
||||
@Comment("Overrides the size of the DB Connection Pool, -1 = Auto")
|
||||
public static final Property<Integer> MYSQL_POOL_SIZE =
|
||||
newProperty("DataSource.poolSize", -1);
|
||||
|
||||
private DatabaseSettings() {
|
||||
}
|
||||
|
||||
|
@ -40,6 +40,8 @@ DataSource:
|
||||
mySQLlastlocWorld: world
|
||||
# Column for RealName
|
||||
mySQLRealName: realname
|
||||
# Overrides the size of the DB Connection Pool, -1 = Auto
|
||||
poolSize: -1
|
||||
settings:
|
||||
sessions:
|
||||
# Do you want to enable the session feature?
|
||||
|
Loading…
Reference in New Issue
Block a user