mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-27 03:27:37 +01:00
Fixed Bukkit server nagging about internal error when setup succeeded.
This commit is contained in:
parent
cdbd8f9496
commit
66b145f7f9
@ -62,13 +62,15 @@ public class SaveDBSettingsRequest extends InfoRequestWithVariables implements S
|
||||
return new BadRequestResponse("Bungee config settings overridden on this server.");
|
||||
}
|
||||
|
||||
setSettings(variables);
|
||||
Log.info("----------------------------------");
|
||||
Log.info("The Received Bungee Database Settings, restarting Plan..");
|
||||
Log.info("----------------------------------");
|
||||
Plan.getInstance().reloadPlugin(true);
|
||||
|
||||
return DefaultResponses.SUCCESS.get();
|
||||
try {
|
||||
setSettings(variables);
|
||||
Log.info("----------------------------------");
|
||||
Log.info("The Received Bungee Database Settings, restarting Plan..");
|
||||
Log.info("----------------------------------");
|
||||
return DefaultResponses.SUCCESS.get();
|
||||
} finally {
|
||||
Plan.getInstance().reloadPlugin(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void setSettings(Map<String, String> variables) throws BadRequestException {
|
||||
|
@ -5,6 +5,7 @@
|
||||
package com.djrapitops.plan.system.info.request;
|
||||
|
||||
import com.djrapitops.plan.api.exceptions.connection.BadRequestException;
|
||||
import com.djrapitops.plan.api.exceptions.connection.ConnectionFailException;
|
||||
import com.djrapitops.plan.api.exceptions.connection.WebException;
|
||||
import com.djrapitops.plan.system.info.InfoSystem;
|
||||
import com.djrapitops.plan.system.info.server.Server;
|
||||
@ -15,6 +16,7 @@ import com.djrapitops.plan.system.webserver.response.api.BadRequestResponse;
|
||||
import com.djrapitops.plugin.api.Check;
|
||||
import com.djrapitops.plugin.utilities.Verify;
|
||||
|
||||
import java.net.SocketException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
@ -74,7 +76,14 @@ public class SendDBSettingsRequest extends InfoRequestWithVariables implements S
|
||||
|
||||
Server bukkit = new Server(-1, serverUUID, serverName, address, -1);
|
||||
|
||||
InfoSystem.getInstance().getConnectionSystem().sendInfoRequest(new SaveDBSettingsRequest(), bukkit);
|
||||
try {
|
||||
InfoSystem.getInstance().getConnectionSystem().sendInfoRequest(new SaveDBSettingsRequest(), bukkit);
|
||||
} catch (ConnectionFailException e) {
|
||||
Throwable cause = e.getCause();
|
||||
if (!(cause instanceof SocketException) || !cause.getMessage().contains("Unexpected end of file from server")) {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
return DefaultResponses.SUCCESS.get();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user