Skip to content

Commit 8416a93

Browse files
committed
代码优化
1 parent 8b56263 commit 8416a93

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

src/main/java/com/acgist/snail/net/http/HTTPClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public final boolean equalsCode(int code) {
106106
/**
107107
* <p>HTTP客户端线程池</p>
108108
*/
109-
private static final ExecutorService EXECUTOR = SystemThreadContext.newExecutor(2, 10, 100, 60L, SystemThreadContext.SNAIL_THREAD_HTTP_CLIENT);
109+
private static final ExecutorService EXECUTOR = SystemThreadContext.newExecutor(2, 10, 1000, 60L, SystemThreadContext.SNAIL_THREAD_HTTP_CLIENT);
110110

111111
static {
112112
final StringBuilder userAgentBuilder = new StringBuilder();

src/main/java/com/acgist/snail/net/torrent/utp/bootstrap/UtpRequestQueue.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public final class UtpRequestQueue {
5050
private UtpRequestQueue() {
5151
LOGGER.debug("启动UTP请求队列:{}", QUEUE_SIZE);
5252
this.queues = new ArrayList<>(QUEUE_SIZE);
53-
this.executor = SystemThreadContext.newExecutor(QUEUE_SIZE, QUEUE_SIZE, 1000, 60, SystemThreadContext.SNAIL_THREAD_UTP_HANDLER);
53+
this.executor = SystemThreadContext.newExecutor(QUEUE_SIZE, QUEUE_SIZE, 1000, 60, SystemThreadContext.SNAIL_THREAD_UTP_QUEUE);
5454
buildQueues();
5555
}
5656

src/main/java/com/acgist/snail/system/context/SystemThreadContext.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ public final class SystemThreadContext {
3232
/** 定时线程 */
3333
public static final String SNAIL_THREAD_TIMER = SNAIL_THREAD + "-Timer";
3434
/** BT定时线程 */
35-
public static final String SNAIL_THREAD_BT_TIMER = SNAIL_THREAD + "-BT-Timer";
35+
public static final String SNAIL_THREAD_BT_TIMER = SNAIL_THREAD_BT + "-Timer";
3636
/** JavaFX平台线程 */
3737
public static final String SNAIL_THREAD_PLATFORM = SNAIL_THREAD + "-Platform";
38+
/** UTP队列线程 */
39+
public static final String SNAIL_THREAD_UTP_QUEUE = SNAIL_THREAD + "-UTP-Queue";
3840
/** 下载器线程 */
3941
public static final String SNAIL_THREAD_DOWNLOADER = SNAIL_THREAD + "-Downloader";
4042
/** TCP客户端线程 */
@@ -43,12 +45,8 @@ public final class SystemThreadContext {
4345
public static final String SNAIL_THREAD_TCP_SERVER = SNAIL_THREAD + "-TCP-Server";
4446
/** UDP服务端线程 */
4547
public static final String SNAIL_THREAD_UDP_SERVER = SNAIL_THREAD + "-UDP-Server";
46-
/** UDP处理器线程 */
47-
public static final String SNAIL_THREAD_UTP_HANDLER = SNAIL_THREAD + "-UTP-Handler";
4848
/** HTTP客户端线程 */
4949
public static final String SNAIL_THREAD_HTTP_CLIENT = SNAIL_THREAD + "-HTTP-Client";
50-
/** HTTP服务端线程 */
51-
public static final String SNAIL_THREAD_HTTP_SERVER = SNAIL_THREAD + "-HTTP-Server";
5250

5351
/**
5452
* <p>系统线程池:加快系统运行、防止卡顿</p>

0 commit comments

Comments
 (0)