diff --git a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV2.java b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV2.java index 9cc4b2ac..c9a88f6a 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV2.java +++ b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterControllerV2.java @@ -53,7 +53,7 @@ import java.util.stream.Collectors; @RestController @RequestMapping("/ability/center/v2") public class AbilityCenterControllerV2 { - private static final ExecutorService executor = Executors.newCachedThreadPool(); + private static final ExecutorService executor = Executors.newWorkStealingPool(); private static final Logger logger = LoggerFactory.getLogger(AbilityCenterController.class); private static final ObjectMapper oMapper = new ObjectMapper(); @Autowired @@ -108,10 +108,9 @@ public class AbilityCenterControllerV2 { abilityBatchApplicationDTO.setApplyFlag(applyFlag); // 同一次的申请标识 final Optional deptDTO = Optional.ofNullable(sysDeptService.getByName(bigDateDeptName)); final UserDetail user = SecurityUser.getUser(); - CompletableFuture.runAsync(() -> { - logger.info("处理能力申请!"); + executor.execute(() -> { deal(abilityBatchApplicationDTO, deptDTO, applyFlag, user); - }, executor); + }); return new Result().ok(LocalDateTime.now().toString()); } @@ -132,7 +131,6 @@ public class AbilityCenterControllerV2 { logger.info("申请入参{}", JSON.toJSONString(abilityBatchApplicationDTO)); final Optional deptDTO = Optional.ofNullable(sysDeptService.getByName(bigDateDeptName)); final UserDetail user = SecurityUser.getUser(); - deal(abilityBatchApplicationDTO, deptDTO, applyFlag, user); return new Result().ok(LocalDateTime.now().toString()); }