fix sql && update hippo4j.core.auth.enabled=true in server properties && optimize code in AdapterThreadPoolConfigModificationVerifyServiceImpl and WebThreadPoolConfigModificationVerifyServiceImpl

pull/782/head
yewei 3 years ago
parent 7b3c864ce2
commit adcab381a2

@ -139,11 +139,8 @@ public class ThreadPoolAdapterService {
public static void remove(String identify) { public static void remove(String identify) {
synchronized (ThreadPoolAdapterService.class) { synchronized (ThreadPoolAdapterService.class) {
THREAD_POOL_ADAPTER_MAP.values().forEach(each -> each.forEach((key, val) -> THREAD_POOL_ADAPTER_MAP.values()
val.forEach((threadPoolKey, states) -> .forEach(each -> each.forEach((key, val) -> val.forEach((threadPoolKey, states) -> states.removeIf(adapterState -> Objects.equals(adapterState.getIdentify(), identify)))));
states.removeIf(adapterState -> Objects.equals(adapterState.getIdentify(), identify))
)
));
} }
} }

@ -46,7 +46,6 @@ public class AdapterThreadPoolConfigModificationVerifyServiceImpl extends Abstra
protected void updateThreadPoolParameter(ConfigModifyVerifyReqDTO reqDTO) { protected void updateThreadPoolParameter(ConfigModifyVerifyReqDTO reqDTO) {
for (String each : getClientAddress(reqDTO)) { for (String each : getClientAddress(reqDTO)) {
String urlString = StringUtil.newBuilder("http://", each, "/adapter/thread-pool/update"); String urlString = StringUtil.newBuilder("http://", each, "/adapter/thread-pool/update");
RestTemplate restTemplate = new RestTemplate();
// again appoint MediaType // again appoint MediaType
HttpHeaders requestHeaders = new HttpHeaders(); HttpHeaders requestHeaders = new HttpHeaders();
requestHeaders.setContentType(MediaType.APPLICATION_JSON); requestHeaders.setContentType(MediaType.APPLICATION_JSON);

@ -46,7 +46,6 @@ public class WebThreadPoolConfigModificationVerifyServiceImpl extends AbstractCo
protected void updateThreadPoolParameter(ConfigModifyVerifyReqDTO reqDTO) { protected void updateThreadPoolParameter(ConfigModifyVerifyReqDTO reqDTO) {
for (String each : getClientAddress(reqDTO)) { for (String each : getClientAddress(reqDTO)) {
String urlString = StringUtil.newBuilder("http://", each, "/web/update/pool"); String urlString = StringUtil.newBuilder("http://", each, "/web/update/pool");
RestTemplate restTemplate = new RestTemplate();
// again appoint MediaType // again appoint MediaType
HttpHeaders requestHeaders = new HttpHeaders(); HttpHeaders requestHeaders = new HttpHeaders();
requestHeaders.setContentType(MediaType.APPLICATION_JSON); requestHeaders.setContentType(MediaType.APPLICATION_JSON);

@ -22,7 +22,7 @@ hippo4j.core.clean-history-data-period=30
hippo4j.core.clean-history-data-enable=true hippo4j.core.clean-history-data-enable=true
### Whether to enable authentication. ### Whether to enable authentication.
hippo4j.core.auth.enabled=false hippo4j.core.auth.enabled=true
### Initialize the database dialect class. ### Initialize the database dialect class.
hippo4j.database.dialect=mysql hippo4j.database.dialect=mysql

@ -201,8 +201,7 @@ CREATE TABLE IF NOT EXISTS `notify` (
-- ---------------------------- -- ----------------------------
-- Table structure for his_config_verify -- Table structure for his_config_verify
-- ---------------------------- -- ----------------------------
DROP TABLE IF EXISTS `his_config_verify`; CREATE TABLE IF NOT EXISTS `his_config_verify` (
CREATE TABLE `his_config_verify` (
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT, `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
`type` int NULL DEFAULT NULL COMMENT '变更类型', `type` int NULL DEFAULT NULL COMMENT '变更类型',
`mark` varchar(128) DEFAULT NULL COMMENT '框架线程池类型', `mark` varchar(128) DEFAULT NULL COMMENT '框架线程池类型',

Loading…
Cancel
Save