mirror of
https://github.com/LamGC/ContentGrabbingJi.git
synced 2025-07-04 22:37:26 +00:00
[Change] 调整包路径;
[Change] 修改 CQPluginMain 功能, 将命令处理的具体细节迁移;
This commit is contained in:
27
src/main/java/net/lamgc/cgj/bot/CQConfig.java
Normal file
27
src/main/java/net/lamgc/cgj/bot/CQConfig.java
Normal file
@ -0,0 +1,27 @@
|
||||
package net.lamgc.cgj.bot;
|
||||
|
||||
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()
|
||||
);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user