diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/refresher/AbstractCoreThreadPoolDynamicRefresh.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/refresher/AbstractCoreThreadPoolDynamicRefresh.java index 1d7da1f0..eea9968b 100644 --- a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/refresher/AbstractCoreThreadPoolDynamicRefresh.java +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/starter/refresher/AbstractCoreThreadPoolDynamicRefresh.java @@ -251,11 +251,10 @@ public abstract class AbstractCoreThreadPoolDynamicRefresh implements ThreadPool private void dynamicRefreshPool(String threadPoolId, ExecutorProperties properties) { ExecutorProperties beforeProperties = GlobalCoreThreadPoolManage.getProperties(properties.getThreadPoolId()); ThreadPoolExecutor executor = GlobalThreadPoolManage.getExecutorService(threadPoolId).getExecutor(); - - if (properties.getMaximumPoolSize() != null && properties.getCorePoolSize() !=null) { + if (properties.getMaximumPoolSize() != null && properties.getCorePoolSize() != null) { if (properties.getMaximumPoolSize() < executor.getMaximumPoolSize()) { - executor.setMaximumPoolSize(properties.getMaximumPoolSize()); executor.setCorePoolSize(properties.getCorePoolSize()); + executor.setMaximumPoolSize(properties.getMaximumPoolSize()); } else { executor.setMaximumPoolSize(properties.getMaximumPoolSize()); executor.setCorePoolSize(properties.getCorePoolSize()); @@ -264,11 +263,10 @@ public abstract class AbstractCoreThreadPoolDynamicRefresh implements ThreadPool if (properties.getMaximumPoolSize() != null) { executor.setMaximumPoolSize(properties.getMaximumPoolSize()); } - if (properties.getCorePoolSize() !=null) { + if (properties.getCorePoolSize() != null) { executor.setCorePoolSize(properties.getCorePoolSize()); } } - if (!Objects.equals(beforeProperties.getAllowCoreThreadTimeOut(), properties.getAllowCoreThreadTimeOut())) { executor.allowCoreThreadTimeOut(properties.getAllowCoreThreadTimeOut()); }