...
This commit is contained in:
parent
81fe70aa42
commit
859edc9864
|
@ -43,7 +43,7 @@ import java.util.concurrent.Executors;
|
|||
public class ActivitiNoticeAspect {
|
||||
|
||||
private static final Integer CPU_NUM = Runtime.getRuntime().availableProcessors();
|
||||
private static final ExecutorService EXECUTOR = Executors.newFixedThreadPool(CPU_NUM * 3);
|
||||
private static final ExecutorService EXECUTOR = Executors.newWorkStealingPool(CPU_NUM * 3);
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(ActivitiNoticeAspect.class);
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -46,7 +46,7 @@ import java.util.stream.Collectors;
|
|||
@RequestMapping("/ability/center")
|
||||
public class AbilityCenterController {
|
||||
private static final Integer cpuNUm = Runtime.getRuntime().availableProcessors();
|
||||
private static final ExecutorService executor = Executors.newFixedThreadPool(cpuNUm);
|
||||
private static final ExecutorService executor = Executors.newWorkStealingPool(cpuNUm);
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(AbilityCenterController.class);
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ import java.util.stream.Collectors;
|
|||
public class CensusController {
|
||||
private static final Logger logger = LoggerFactory.getLogger(CensusController.class);
|
||||
private static final Integer CPUNUM = Runtime.getRuntime().availableProcessors();
|
||||
private static final ExecutorService executor = Executors.newFixedThreadPool(CPUNUM);
|
||||
private static final ExecutorService executor = Executors.newWorkStealingPool(CPUNUM);
|
||||
|
||||
@Autowired
|
||||
private ResourceService resourceService;
|
||||
|
|
|
@ -35,7 +35,7 @@ import java.util.concurrent.Executors;
|
|||
@RequestMapping("/comment/center")
|
||||
public class CommentController {
|
||||
private static final Integer CPUNUM = Runtime.getRuntime().availableProcessors();
|
||||
private static final ExecutorService executor = Executors.newFixedThreadPool(CPUNUM);
|
||||
private static final ExecutorService executor = Executors.newWorkStealingPool(CPUNUM);
|
||||
private static final ObjectMapper oMapper = new ObjectMapper();
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -30,7 +30,7 @@ import java.util.concurrent.Executors;
|
|||
@Component
|
||||
public class InitiatorDataEntryListener implements TaskListener {
|
||||
private static final Integer CPU_NUM = Runtime.getRuntime().availableProcessors();
|
||||
private static final ExecutorService EXECUTOR = Executors.newFixedThreadPool(CPU_NUM * 3);
|
||||
private static final ExecutorService EXECUTOR = Executors.newWorkStealingPool(CPU_NUM * 3);
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(InitiatorDataEntryListener.class);
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ public class UpdateUtil {
|
|||
private static final Logger logger = LoggerFactory.getLogger(UpdateUtil.class);
|
||||
|
||||
private static final Integer CPUNUM = Runtime.getRuntime().availableProcessors();
|
||||
private static final ExecutorService executor = Executors.newFixedThreadPool(CPUNUM);
|
||||
private static final ExecutorService executor = Executors.newWorkStealingPool(CPUNUM);
|
||||
private static final String pwd = System.getProperty("user.dir");
|
||||
|
||||
private static final OkHttpClient client = new OkHttpClient().newBuilder().connectTimeout(1, TimeUnit.MINUTES).readTimeout(2, TimeUnit.MINUTES).connectionPool(new ConnectionPool(CPUNUM * 2, 2, TimeUnit.MINUTES)).retryOnConnectionFailure(false).build(); // 下载更新包的工具
|
||||
|
|
|
@ -37,7 +37,7 @@ import java.util.stream.Collectors;
|
|||
@Service
|
||||
public class TDemandCommentServiceImpl extends CrudServiceImpl<TDemandCommentDao, TDemandCommentEntity, TDemandCommentDTO> implements TDemandCommentService {
|
||||
private static final Integer CPUNUM = Runtime.getRuntime().availableProcessors();
|
||||
private static final ExecutorService executor = Executors.newFixedThreadPool(CPUNUM);
|
||||
private static final ExecutorService executor = Executors.newWorkStealingPool(CPUNUM);
|
||||
@Autowired
|
||||
private TDemandDataService tDemandDataService;
|
||||
@Autowired
|
||||
|
|
|
@ -74,7 +74,7 @@ import java.util.stream.Collectors;
|
|||
@Api(tags = "资源表")
|
||||
public class ResourceController {
|
||||
private static final Integer CPUNUM = Runtime.getRuntime().availableProcessors();
|
||||
private static final ExecutorService executor = Executors.newFixedThreadPool(CPUNUM);
|
||||
private static final ExecutorService executor = Executors.newWorkStealingPool(CPUNUM * 2);
|
||||
|
||||
@Value("${big_date.name}")
|
||||
private String bigDateDeptName; // 大数据局名称
|
||||
|
@ -264,7 +264,7 @@ public class ResourceController {
|
|||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/updateTest")
|
||||
@GetMapping("/updateInfoList")
|
||||
public Result<String> updateTest() {
|
||||
CompletableFuture.runAsync(() -> {
|
||||
List<Long> ids = jdbcTemplate.queryForList("SELECT id FROM tb_data_resource", Long.class);
|
||||
|
|
Loading…
Reference in New Issue