mirror of
https://github.com/LamGC/ContentGrabbingJi.git
synced 2025-04-30 06:37:36 +00:00
[Update] 补充Javadoc; [Change] 根据性能分析结果调整imageCacheExecutor线程池参数; [Change] 调整CQGlobal内线程池参数; [Change] 将illustPages缓存纳入Redis缓存库; [Change] 根据性能分析结果将SpringBoot的HttpThreads降至1;
28 lines
848 B
Java
28 lines
848 B
Java
package net.lamgc.cgj;
|
|
|
|
import com.google.common.util.concurrent.ThreadFactoryBuilder;
|
|
import net.lz1998.cq.CQGlobal;
|
|
import net.lz1998.cq.EnableCQ;
|
|
|
|
import java.util.concurrent.LinkedBlockingQueue;
|
|
import java.util.concurrent.ThreadPoolExecutor;
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
@EnableCQ
|
|
public class CQConfig {
|
|
|
|
public static void init() {
|
|
CQGlobal.pluginList.add(CQPluginMain.class);
|
|
CQGlobal.executor = new ThreadPoolExecutor(
|
|
(int) Math.ceil(Runtime.getRuntime().availableProcessors() / 2F),
|
|
Runtime.getRuntime().availableProcessors(),
|
|
25, TimeUnit.SECONDS,
|
|
new LinkedBlockingQueue<>(512),
|
|
new ThreadFactoryBuilder()
|
|
.setNameFormat("Plugin-ProcessThread-%d")
|
|
.build()
|
|
);
|
|
}
|
|
|
|
}
|