Showing
1 changed file
with
2 additions
and
0 deletions
| ... | @@ -4,6 +4,7 @@ import com.infoloop.tianting.context.LoginContextHolder; | ... | @@ -4,6 +4,7 @@ import com.infoloop.tianting.context.LoginContextHolder; |
| 4 | import lombok.extern.slf4j.Slf4j; | 4 | import lombok.extern.slf4j.Slf4j; |
| 5 | import org.springframework.context.annotation.Bean; | 5 | import org.springframework.context.annotation.Bean; |
| 6 | import org.springframework.context.annotation.Configuration; | 6 | import org.springframework.context.annotation.Configuration; |
| 7 | +import org.springframework.context.annotation.Primary; | ||
| 7 | import org.springframework.core.task.TaskDecorator; | 8 | import org.springframework.core.task.TaskDecorator; |
| 8 | import org.springframework.scheduling.TaskScheduler; | 9 | import org.springframework.scheduling.TaskScheduler; |
| 9 | import org.springframework.scheduling.annotation.EnableAsync; | 10 | import org.springframework.scheduling.annotation.EnableAsync; |
| ... | @@ -23,6 +24,7 @@ import static com.infoloop.tianting.constant.ConfigConstants.SCHEDULED_TASK_EXEC | ... | @@ -23,6 +24,7 @@ import static com.infoloop.tianting.constant.ConfigConstants.SCHEDULED_TASK_EXEC |
| 23 | @EnableAsync | 24 | @EnableAsync |
| 24 | public class TaskPoolConfig { | 25 | public class TaskPoolConfig { |
| 25 | 26 | ||
| 27 | + @Primary | ||
| 26 | @Bean(SCHEDULED_TASK_EXECUTOR) | 28 | @Bean(SCHEDULED_TASK_EXECUTOR) |
| 27 | public TaskScheduler scheduledExecutorService() { | 29 | public TaskScheduler scheduledExecutorService() { |
| 28 | final var scheduler = new ThreadPoolTaskScheduler(); | 30 | final var scheduler = new ThreadPoolTaskScheduler(); | ... | ... |
-
Please register or login to post a comment