1 | package org.cardanofoundation.explorer.api.config; | |
2 | ||
3 | import org.springframework.context.annotation.Bean; | |
4 | import org.springframework.context.annotation.Configuration; | |
5 | import org.springframework.core.task.TaskExecutor; | |
6 | import org.springframework.scheduling.annotation.EnableAsync; | |
7 | import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | |
8 | ||
9 | @Configuration | |
10 | @EnableAsync | |
11 | public class ThreadPoolConfig { | |
12 | ||
13 | private static final int CORE_POOL_SIZE = 20; | |
14 | private static final int MAX_POOL_SIZE = 50; | |
15 | private static final int QUEUE_CAPACITY = 100; | |
16 | ||
17 | @Bean(name = "taskExecutor") | |
18 | public TaskExecutor taskExecutor() { | |
19 | ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); | |
20 |
1
1. taskExecutor : removed call to org/springframework/scheduling/concurrent/ThreadPoolTaskExecutor::setCorePoolSize → NO_COVERAGE |
executor.setCorePoolSize(CORE_POOL_SIZE); |
21 |
1
1. taskExecutor : removed call to org/springframework/scheduling/concurrent/ThreadPoolTaskExecutor::setMaxPoolSize → NO_COVERAGE |
executor.setMaxPoolSize(MAX_POOL_SIZE); |
22 |
1
1. taskExecutor : removed call to org/springframework/scheduling/concurrent/ThreadPoolTaskExecutor::setQueueCapacity → NO_COVERAGE |
executor.setQueueCapacity(QUEUE_CAPACITY); |
23 |
1
1. taskExecutor : removed call to org/springframework/scheduling/concurrent/ThreadPoolTaskExecutor::setThreadNamePrefix → NO_COVERAGE |
executor.setThreadNamePrefix("Async-Explorer-"); |
24 |
1
1. taskExecutor : removed call to org/springframework/scheduling/concurrent/ThreadPoolTaskExecutor::setWaitForTasksToCompleteOnShutdown → NO_COVERAGE |
executor.setWaitForTasksToCompleteOnShutdown(true); |
25 |
1
1. taskExecutor : removed call to org/springframework/scheduling/concurrent/ThreadPoolTaskExecutor::initialize → NO_COVERAGE |
executor.initialize(); |
26 |
1
1. taskExecutor : replaced return value with null for org/cardanofoundation/explorer/api/config/ThreadPoolConfig::taskExecutor → NO_COVERAGE |
return executor; |
27 | } | |
28 | } | |
Mutations | ||
20 |
1.1 |
|
21 |
1.1 |
|
22 |
1.1 |
|
23 |
1.1 |
|
24 |
1.1 |
|
25 |
1.1 |
|
26 |
1.1 |