File tree Expand file tree Collapse file tree
java/top/cadecode/uniboot
framework/src/main/java/top/cadecode/uniboot/framework/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package top .cadecode .uniboot ;
22
3- import com .dtp .core .spring .EnableDynamicTp ;
43import org .mybatis .spring .annotation .MapperScan ;
54import org .springframework .boot .SpringApplication ;
65import org .springframework .boot .autoconfigure .SpringBootApplication ;
7- import org .springframework .boot .autoconfigure .jdbc .DataSourceAutoConfiguration ;
86import org .springframework .boot .builder .SpringApplicationBuilder ;
97import org .springframework .boot .web .servlet .support .SpringBootServletInitializer ;
108import org .springframework .context .annotation .EnableAspectJAutoProxy ;
119
1210/**
1311 * 启动类
1412 */
15- @ EnableDynamicTp
1613@ MapperScan ("top.cadecode.**.mapper" )
1714@ EnableAspectJAutoProxy (exposeProxy = true )
18- @ SpringBootApplication ( exclude = DataSourceAutoConfiguration . class )
15+ @ SpringBootApplication
1916public class UniBootApplication extends SpringBootServletInitializer {
2017
2118 public static void main (String [] args ) {
@@ -26,5 +23,4 @@ public static void main(String[] args) {
2623 protected SpringApplicationBuilder configure (SpringApplicationBuilder application ) {
2724 return application .sources (UniBootApplication .class );
2825 }
29-
3026}
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ spring:
5757 monitorInterval : 10
5858 executors :
5959 - threadPoolName : asyncExecutor
60- thread-name-prefix : asyncExecutor
60+ thread-name-prefix : asyncExecutor-
6161 corePoolSize : 6
6262 maximumPoolSize : 8
6363 queueCapacity : 1000
Original file line number Diff line number Diff line change 11package top .cadecode .uniboot .framework .config ;
22
33import com .dtp .core .DtpRegistry ;
4+ import com .dtp .core .spring .EnableDynamicTp ;
45import lombok .extern .slf4j .Slf4j ;
56import org .springframework .aop .interceptor .AsyncUncaughtExceptionHandler ;
67import org .springframework .context .annotation .Bean ;
78import org .springframework .context .annotation .Configuration ;
89import org .springframework .scheduling .annotation .AsyncConfigurer ;
10+ import org .springframework .scheduling .annotation .EnableAsync ;
11+ import org .springframework .scheduling .annotation .EnableScheduling ;
912import org .springframework .scheduling .annotation .SchedulingConfigurer ;
1013import org .springframework .scheduling .concurrent .ThreadPoolTaskScheduler ;
1114
1821 * @date 2023/3/15
1922 */
2023@ Slf4j
24+ @ EnableDynamicTp
25+ @ EnableAsync
26+ @ EnableScheduling
2127@ Configuration
2228public class ThreadPoolConfig {
2329
@@ -28,7 +34,7 @@ public class ThreadPoolConfig {
2834 public ThreadPoolTaskScheduler taskScheduler () {
2935 ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler ();
3036 scheduler .setPoolSize (6 );
31- scheduler .setThreadNamePrefix ("taskScheduler" );
37+ scheduler .setThreadNamePrefix ("taskScheduler- " );
3238 scheduler .setWaitForTasksToCompleteOnShutdown (true );
3339 scheduler .setAwaitTerminationSeconds (5 );
3440 return scheduler ;
You can’t perform that action at this time.
0 commit comments