File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
java/life/qbic/data_download/rest/config Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 1919@ EnableAsync
2020public class AsyncDownloadConfig implements AsyncConfigurer {
2121
22+ @ Value ("${spring.async.threadpool.core-size}" )
23+ private int corePoolSize ;
24+ @ Value ("${spring.async.threadpool.max-size}" )
25+ private int maxPoolSize ;
26+ @ Value ("${spring.async.threadpool.queue-capacity}" )
27+ private int queueCapacity ;
28+
2229 @ Override
2330 @ Bean ("taskExecutor" )
2431 public AsyncTaskExecutor getAsyncExecutor () {
2532 ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor ();
26- threadPoolTaskExecutor .setCorePoolSize (2 );
27- threadPoolTaskExecutor .setMaxPoolSize (5 );
28- threadPoolTaskExecutor .setQueueCapacity (200 );
33+ threadPoolTaskExecutor .setCorePoolSize (corePoolSize );
34+ threadPoolTaskExecutor .setMaxPoolSize (maxPoolSize );
35+ threadPoolTaskExecutor .setQueueCapacity (queueCapacity );
2936 threadPoolTaskExecutor .setThreadNamePrefix ("download - " );
3037 threadPoolTaskExecutor .initialize ();
3138 return threadPoolTaskExecutor ;
Original file line number Diff line number Diff line change @@ -59,3 +59,7 @@ server.tomcat.remoteip.protocol-header=x-forwarded-proto
5959spring.mvc.async.request-timeout =2d
6060# the timeout of a session
6161spring.session.timeout =2d
62+
63+ spring.async.threadpool.core-size =${ASYNC_CORE_SIZE:2}
64+ spring.async.threadpool.max-size =${ASYNC_MAX_SIZE:5}
65+ spring.async.threadpool.queue-capacity =${ASYNC_QUEUE_SIZE:2}
You can’t perform that action at this time.
0 commit comments