Skip to content

Commit

Permalink
Cleanup resource
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbumenJ committed Sep 1, 2023
1 parent f720ffe commit 3c7b6a9
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ public List<ProtocolServer> getServers() {
return protocol.getServers();
}

private void startQosServer(URL url) {
private void startQosServer(URL url) throws RpcException {
boolean qosCheck = url.getParameter(QOS_CHECK, false);

try {
if (!hasStarted.compareAndSet(false, true)) {
return;
Expand All @@ -112,7 +114,6 @@ private void startQosServer(URL url) {

String host = url.getParameter(QOS_HOST);
int port = url.getParameter(QOS_PORT, QosConstants.DEFAULT_PORT);
boolean qosCheck = url.getParameter(QOS_CHECK, false);
boolean acceptForeignIp = Boolean.parseBoolean(url.getParameter(ACCEPT_FOREIGN_IP, "false"));
String acceptForeignIpWhitelist = url.getParameter(ACCEPT_FOREIGN_IP_WHITELIST, StringUtils.EMPTY_STRING);
String anonymousAccessPermissionLevel = url.getParameter(ANONYMOUS_ACCESS_PERMISSION_LEVEL, PermissionLevel.PUBLIC.name());
Expand All @@ -133,9 +134,8 @@ private void startQosServer(URL url) {

} catch (Throwable throwable) {
logger.warn(QOS_FAILED_START_SERVER, "", "", "Fail to start qos server: ", throwable);
boolean qosCheck = url.getParameter(QOS_CHECK, false);
if (qosCheck) {
throw new IllegalStateException("Fail to start qos server: " + throwable.getMessage(), throwable);
throw new RpcException(throwable);
}
}
}
Expand Down

0 comments on commit 3c7b6a9

Please sign in to comment.