Refactored hippo4j-core spring post processor logic. (#177)

pull/182/head
chen.ma 3 years ago
parent e3796a9805
commit 78ba79b2a7

@ -124,7 +124,7 @@ public final class DynamicThreadPoolPostProcessor implements BeanPostProcessor {
if (dynamicThreadPoolWrap.getExecutor() instanceof AbstractDynamicExecutorSupport) {
// 设置动态线程池增强参数
ThreadPoolNotifyAlarm notify = executorProperties.getNotify();
ThreadPoolNotifyAlarm notify = Optional.ofNullable(executorProperties).map(ExecutorProperties::getNotify).orElse(null);
boolean isAlarm = Optional.ofNullable(notify)
.map(each -> each.getIsAlarm())
.orElseGet(() -> bootstrapCoreProperties.getAlarm() != null ? bootstrapCoreProperties.getAlarm() : true);
@ -194,5 +194,4 @@ public final class DynamicThreadPoolPostProcessor implements BeanPostProcessor {
return executorProperties;
}
}

Loading…
Cancel
Save