mirror of
https://github.com/continew-org/continew-starter.git
synced 2025-09-10 08:57:19 +08:00
chore: 完善 ConditionalOnProperty 配置
This commit is contained in:
@@ -42,7 +42,7 @@ import java.util.concurrent.Executor;
|
||||
@Lazy
|
||||
@AutoConfiguration
|
||||
@EnableAsync(proxyTargetClass = true)
|
||||
@ConditionalOnProperty(prefix = "spring.task.execution.extension", name = PropertiesConstants.ENABLED, matchIfMissing = true)
|
||||
@ConditionalOnProperty(prefix = "spring.task.execution.extension", name = PropertiesConstants.ENABLED, havingValue = "true", matchIfMissing = true)
|
||||
public class AsyncAutoConfiguration implements AsyncConfigurer {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(AsyncAutoConfiguration.class);
|
||||
|
@@ -52,7 +52,7 @@ public class ThreadPoolAutoConfiguration {
|
||||
* 异步任务线程池配置
|
||||
*/
|
||||
@Bean
|
||||
@ConditionalOnProperty(prefix = "spring.task.execution.extension", name = PropertiesConstants.ENABLED, matchIfMissing = true)
|
||||
@ConditionalOnProperty(prefix = "spring.task.execution.extension", name = PropertiesConstants.ENABLED, havingValue = "true", matchIfMissing = true)
|
||||
public ThreadPoolTaskExecutorCustomizer threadPoolTaskExecutorCustomizer(ThreadPoolExtensionProperties properties) {
|
||||
return executor -> {
|
||||
// 核心(最小)线程数
|
||||
@@ -71,7 +71,7 @@ public class ThreadPoolAutoConfiguration {
|
||||
* 定时任务线程池配置
|
||||
*/
|
||||
@EnableScheduling
|
||||
@ConditionalOnProperty(prefix = "spring.task.scheduling.extension", name = PropertiesConstants.ENABLED, matchIfMissing = true)
|
||||
@ConditionalOnProperty(prefix = "spring.task.scheduling.extension", name = PropertiesConstants.ENABLED, havingValue = "true", matchIfMissing = true)
|
||||
public static class TaskSchedulerConfiguration {
|
||||
@Bean
|
||||
public ThreadPoolTaskSchedulerCustomizer threadPoolTaskSchedulerCustomizer(ThreadPoolExtensionProperties properties) {
|
||||
|
Reference in New Issue
Block a user