Merge branch 'master' of https://github.com/AuthMe/AuthMeReloaded into 930-captcha-for-register

This commit is contained in:
ljacqu
2017-12-22 21:54:58 +01:00
20 changed files with 194 additions and 88 deletions
@@ -70,6 +70,7 @@ public class SettingsMigrationService extends PlainMigrationService {
| performMailTextToFileMigration(resource)
| migrateJoinLeaveMessages(resource)
| migrateForceSpawnSettings(resource)
| migratePoolSizeSetting(resource)
| changeBooleanSettingToLogLevelProperty(resource)
| hasOldHelpHeaderProperty(resource)
| hasSupportOldPasswordProperty(resource)
@@ -194,6 +195,21 @@ public class SettingsMigrationService extends PlainMigrationService {
| moveProperty(oldForceWorlds, FORCE_SPAWN_ON_WORLDS, resource);
}
/**
* Detects the old auto poolSize value and replaces it with the default value.
*
* @param resource The property resource
* @return True if the configuration has changed, false otherwise
*/
private static boolean migratePoolSizeSetting(PropertyResource resource) {
Integer oldValue = resource.getInt("DataSource.poolSize");
if(oldValue == null || oldValue > 0) {
return false;
}
resource.setValue("DataSource.poolSize", 10);
return true;
}
/**
* Changes the old boolean property "hide spam from console" to the new property specifying
* the log level.
@@ -123,9 +123,9 @@ public final 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")
@Comment("Overrides the size of the DB Connection Pool, default = 10")
public static final Property<Integer> MYSQL_POOL_SIZE =
newProperty("DataSource.poolSize", -1);
newProperty("DataSource.poolSize", 10);
@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"})