diff --git a/renren-admin/src/main/java/io/renren/common/aspect/ActivitiNoticeAspect.java b/renren-admin/src/main/java/io/renren/common/aspect/ActivitiNoticeAspect.java index 6b97fd9e..0c5af3dc 100644 --- a/renren-admin/src/main/java/io/renren/common/aspect/ActivitiNoticeAspect.java +++ b/renren-admin/src/main/java/io/renren/common/aspect/ActivitiNoticeAspect.java @@ -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 diff --git a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterController.java b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterController.java index 2f05d262..b1825ac4 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterController.java +++ b/renren-admin/src/main/java/io/renren/common/controller/AbilityCenterController.java @@ -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); diff --git a/renren-admin/src/main/java/io/renren/common/controller/CensusController.java b/renren-admin/src/main/java/io/renren/common/controller/CensusController.java index 0713ace5..bc599e7a 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/CensusController.java +++ b/renren-admin/src/main/java/io/renren/common/controller/CensusController.java @@ -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; diff --git a/renren-admin/src/main/java/io/renren/common/controller/CommentController.java b/renren-admin/src/main/java/io/renren/common/controller/CommentController.java index 818fa3de..73c2a6c2 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/CommentController.java +++ b/renren-admin/src/main/java/io/renren/common/controller/CommentController.java @@ -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 diff --git a/renren-admin/src/main/java/io/renren/common/listener/InitiatorDataEntryListener.java b/renren-admin/src/main/java/io/renren/common/listener/InitiatorDataEntryListener.java index 4c9d1dd0..4d97e7d6 100644 --- a/renren-admin/src/main/java/io/renren/common/listener/InitiatorDataEntryListener.java +++ b/renren-admin/src/main/java/io/renren/common/listener/InitiatorDataEntryListener.java @@ -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); diff --git a/renren-admin/src/main/java/io/renren/common/utils/UpdateUtil.java b/renren-admin/src/main/java/io/renren/common/utils/UpdateUtil.java index 2719c7b3..ff19fb0b 100644 --- a/renren-admin/src/main/java/io/renren/common/utils/UpdateUtil.java +++ b/renren-admin/src/main/java/io/renren/common/utils/UpdateUtil.java @@ -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(); // 下载更新包的工具 diff --git a/renren-admin/src/main/java/io/renren/modules/demandComment/service/impl/TDemandCommentServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/demandComment/service/impl/TDemandCommentServiceImpl.java index 06efe7a4..ef09d653 100644 --- a/renren-admin/src/main/java/io/renren/modules/demandComment/service/impl/TDemandCommentServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/demandComment/service/impl/TDemandCommentServiceImpl.java @@ -41,7 +41,7 @@ public class TDemandCommentServiceImpl extends CrudServiceImpl updateTest() { CompletableFuture.runAsync(() -> { List ids = jdbcTemplate.queryForList("SELECT id FROM tb_data_resource", Long.class);