diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ServerThreadPoolDynamicRefresh.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ServerThreadPoolDynamicRefresh.java index c756bd42..d0b8facc 100644 --- a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ServerThreadPoolDynamicRefresh.java +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/ServerThreadPoolDynamicRefresh.java @@ -123,12 +123,21 @@ public class ServerThreadPoolDynamicRefresh implements ThreadPoolDynamicRefresh * @param parameter */ public void changePoolInfo(ThreadPoolExecutor executor, PoolParameter parameter) { - if (parameter.getCoreSize() != null) { - executor.setCorePoolSize(parameter.getCoreSize()); - } - - if (parameter.getMaxSize() != null) { - executor.setMaximumPoolSize(parameter.getMaxSize()); + if (parameter.getCoreSize() != null&¶meter.getMaxSize() !=null) { + if (parameter.getMaxSize() < executor.getMaximumPoolSize()) { + executor.setCorePoolSize(parameter.getCoreSize()); + executor.setMaximumPoolSize(parameter.getMaxSize()); + } else { + executor.setMaximumPoolSize(parameter.getMaxSize()); + executor.setCorePoolSize(parameter.getCoreSize()); + } + }else { + if (parameter.getMaxSize() != null) { + executor.setMaximumPoolSize(parameter.getMaxSize()); + } + if (parameter.getCoreSize() != null) { + executor.setCorePoolSize(parameter.getCoreSize()); + } } if (parameter.getCapacity() != null