#1130: Add scheduler unit tests and make more robust.
This commit is contained in:
@@ -96,8 +96,9 @@ public class Plugin
|
||||
{
|
||||
if ( service == null )
|
||||
{
|
||||
service = Executors.newCachedThreadPool( new ThreadFactoryBuilder().setNameFormat( getDescription().getName() + " Pool Thread #%1$d" )
|
||||
.setThreadFactory( new GroupedThreadFactory( this ) ).build() );
|
||||
String name = ( getDescription() == null ) ? "unknown" : getDescription().getName();
|
||||
service = Executors.newCachedThreadPool( new ThreadFactoryBuilder().setNameFormat( name + " Pool Thread #%1$d" )
|
||||
.setThreadFactory( new GroupedThreadFactory( this, name ) ).build() );
|
||||
}
|
||||
return service;
|
||||
}
|
||||
|
@@ -21,9 +21,9 @@ public class GroupedThreadFactory implements ThreadFactory
|
||||
|
||||
}
|
||||
|
||||
public GroupedThreadFactory(Plugin plugin)
|
||||
public GroupedThreadFactory(Plugin plugin, String name)
|
||||
{
|
||||
this.group = new BungeeGroup( plugin.getDescription().getName() );
|
||||
this.group = new BungeeGroup( name );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user