Fix detection of ScheduledExecutorService

`@EnableScheduling` detects primarily a suitable `TaskScheduler` in the
context and fallbacks to the presence of a `ScheduledExecutorService` if
that is not the case.

This commit improves the auto-configuration to back off when such
scheduled executor service is present, so that the framework
initialization code can pick it up as usual.

Closes gh-15032
This commit is contained in:
Stephane Nicoll
2018-11-04 09:58:41 +01:00
parent c7909318cd
commit 0bd69fded8
3 changed files with 31 additions and 3 deletions

View File

@@ -6382,8 +6382,8 @@ A `ThreadPoolTaskScheduler` can also be auto-configured if need to be associated
scheduled task execution (`@EnableScheduling`). The thread pool uses one thread by default
and those settings can be fine-tuned using the `spring.task.scheduling` namespace.
Both a `TaskExecutorBuilder` bean and a `TaskSchedulerBuilder` bean are made available in the
context if a custom executor or scheduler needs to be created.
Both a `TaskExecutorBuilder` bean and a `TaskSchedulerBuilder` bean are made available in
the context if a custom executor or scheduler needs to be created.