Fix: WebExecutorProperties npe problem. (#1162)

pull/1165/head
yanrongzhen 1 year ago committed by GitHub
parent c29a36fae4
commit be636bf08a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -117,14 +117,14 @@ public class ThreadPoolRunStateInfo extends ThreadPoolBaseInfo implements Serial
private Long timestamp; private Long timestamp;
public Integer getSimpleCurrentLoad() { public Integer getSimpleCurrentLoad() {
if (Objects.nonNull(getCurrentLoad())){ if (Objects.nonNull(getCurrentLoad())) {
return Integer.parseInt(getCurrentLoad().replace("%", "")); return Integer.parseInt(getCurrentLoad().replace("%", ""));
} }
return null; return null;
} }
public Integer getSimplePeakLoad() { public Integer getSimplePeakLoad() {
if (Objects.nonNull(getPeakLoad())){ if (Objects.nonNull(getPeakLoad())) {
return Integer.parseInt(getPeakLoad().replace("%", "")); return Integer.parseInt(getPeakLoad().replace("%", ""));
} }
return null; return null;

@ -70,6 +70,9 @@ public class ConfigModeNotifyConfigBuilder implements NotifyConfigBuilder {
} }
// register notify config for web // register notify config for web
WebExecutorProperties webProperties = configProperties.getWeb(); WebExecutorProperties webProperties = configProperties.getWeb();
if (webProperties == null) {
return resultMap;
}
if (StringUtil.isBlank(webProperties.getThreadPoolId())) { if (StringUtil.isBlank(webProperties.getThreadPoolId())) {
webProperties.setThreadPoolId(webThreadPoolService.getWebContainerType().name()); webProperties.setThreadPoolId(webThreadPoolService.getWebContainerType().name());
} }

Loading…
Cancel
Save