#1190 Show settings warnings on reload also (#1384)

- Extract setting checks into their own class, called on startup and reload
This commit is contained in:
ljacqu
2017-10-28 14:15:38 +02:00
committed by GitHub
parent d40109929c
commit 04c5224e99
5 changed files with 150 additions and 28 deletions
@@ -10,6 +10,7 @@ import fr.xephi.authme.initialization.factory.SingletonStore;
import fr.xephi.authme.message.MessageKey;
import fr.xephi.authme.service.CommonService;
import fr.xephi.authme.settings.Settings;
import fr.xephi.authme.settings.SettingsWarner;
import fr.xephi.authme.settings.properties.DatabaseSettings;
import fr.xephi.authme.util.Utils;
import org.bukkit.command.CommandSender;
@@ -34,6 +35,9 @@ public class ReloadCommand implements ExecutableCommand {
@Inject
private CommonService commonService;
@Inject
private SettingsWarner settingsWarner;
@Inject
private SingletonStore<Reloadable> reloadableStore;
@@ -45,6 +49,8 @@ public class ReloadCommand implements ExecutableCommand {
try {
settings.reload();
ConsoleLogger.setLoggingOptions(settings);
settingsWarner.logWarningsForMisconfigurations();
// We do not change database type for consistency issues, but we'll output a note in the logs
if (!settings.getProperty(DatabaseSettings.BACKEND).equals(dataSource.getType())) {
Utils.logAndSendMessage(sender, "Note: cannot change database type during /authme reload");