mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-30 22:24:18 +01:00
Work around JDK stupidity with regards to thread count
This commit is contained in:
parent
a59e0f0b6b
commit
5e31b158e9
@ -76,7 +76,8 @@ public class BungeeCord extends ProxyServer
|
|||||||
/**
|
/**
|
||||||
* Thread pools.
|
* Thread pools.
|
||||||
*/
|
*/
|
||||||
public final ScheduledExecutorService executors = new ScheduledThreadPoolExecutor( 8, new ThreadFactoryBuilder().setNameFormat( "Bungee Pool Thread #%1$d" ).build() );
|
public final ScheduledThreadPoolExecutor executors = new ScheduledThreadPoolExecutor( Integer.MAX_VALUE,
|
||||||
|
new ThreadFactoryBuilder().setNameFormat( "Bungee Pool Thread #%1$d" ).build() );
|
||||||
public final MultithreadEventLoopGroup eventLoops = new NioEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty IO Thread #%1$d" ).build() );
|
public final MultithreadEventLoopGroup eventLoops = new NioEventLoopGroup( 0, new ThreadFactoryBuilder().setNameFormat( "Netty IO Thread #%1$d" ).build() );
|
||||||
/**
|
/**
|
||||||
* locations.yml save thread.
|
* locations.yml save thread.
|
||||||
@ -186,6 +187,9 @@ public class BungeeCord extends ProxyServer
|
|||||||
@Override
|
@Override
|
||||||
public void start() throws Exception
|
public void start() throws Exception
|
||||||
{
|
{
|
||||||
|
executors.setKeepAliveTime( 60, TimeUnit.SECONDS );
|
||||||
|
executors.allowCoreThreadTimeOut( true );
|
||||||
|
|
||||||
pluginsFolder.mkdir();
|
pluginsFolder.mkdir();
|
||||||
pluginManager.loadPlugins( pluginsFolder );
|
pluginManager.loadPlugins( pluginsFolder );
|
||||||
config.load();
|
config.load();
|
||||||
@ -249,7 +253,7 @@ public class BungeeCord extends ProxyServer
|
|||||||
{
|
{
|
||||||
this.isRunning = false;
|
this.isRunning = false;
|
||||||
|
|
||||||
httpClient.closeAsynchronously(); // TODO: Fix
|
httpClient.close();
|
||||||
executors.shutdown();
|
executors.shutdown();
|
||||||
|
|
||||||
stopListeners();
|
stopListeners();
|
||||||
|
Loading…
Reference in New Issue
Block a user