#2209 - Registering [default] as the default server but [default] is already registered as the default exception with hot-reload

This commit is contained in:
Robin Bygrave
2021-03-30 09:56:48 +13:00
parent 5cb9b9b237
commit d988dbe69d
2 changed files with 6 additions and 1 deletions
@@ -78,7 +78,7 @@ public class DatabaseFactory {
Database server = createInternal(config);
if (config.isRegister()) {
if (config.isDefaultServer()) {
if (defaultServerName != null) {
if (defaultServerName != null && !defaultServerName.equals(config.getName())) {
throw new IllegalStateException("Registering [" + config.getName() + "] as the default server but [" + defaultServerName + "] is already registered as the default");
}
defaultServerName = config.getName();