Skip to content

Commit 121930d

Browse files
committed
fix: ensure dispatcher pool to have enough dispatching threads
1 parent 0f26da1 commit 121930d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • cloudnet-driver/src/main/java/de/dytanic/cloudnet/driver/network/netty

cloudnet-driver/src/main/java/de/dytanic/cloudnet/driver/network/netty/NettyUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ public static EventLoopGroup newEventLoopGroup() {
8181
}
8282

8383
public static Executor newPacketDispatcher() {
84-
// a cached pool with a thread idle-lifetime of 30 seconds
8584
// rejected tasks will be executed on the calling thread (See ThreadPoolExecutor.CallerRunsPolicy)
86-
return new ThreadPoolExecutor(0, getThreadAmount(),
87-
30L, TimeUnit.SECONDS, new LinkedBlockingQueue<>(), DEFAULT_REJECT_HANDLER);
85+
int maxThreads = getThreadAmount();
86+
return new ThreadPoolExecutor(maxThreads, maxThreads,
87+
0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(), DEFAULT_REJECT_HANDLER);
8888
}
8989

9090
@Deprecated

0 commit comments

Comments
 (0)