mirror of
https://github.com/LuckPerms/LuckPerms.git
synced 2024-11-24 11:38:40 +01:00
Shutdown okhttp on plugin disable (#3347)
This commit is contained in:
parent
eece15d415
commit
5647b2e5c6
@ -91,6 +91,7 @@ public abstract class AbstractLuckPermsPlugin implements LuckPermsPlugin {
|
|||||||
private PermissionRegistry permissionRegistry;
|
private PermissionRegistry permissionRegistry;
|
||||||
private LogDispatcher logDispatcher;
|
private LogDispatcher logDispatcher;
|
||||||
private LuckPermsConfiguration configuration;
|
private LuckPermsConfiguration configuration;
|
||||||
|
private OkHttpClient httpClient;
|
||||||
private BytebinClient bytebin;
|
private BytebinClient bytebin;
|
||||||
private BytesocksClient bytesocks;
|
private BytesocksClient bytesocks;
|
||||||
private WebEditorStore webEditorStore;
|
private WebEditorStore webEditorStore;
|
||||||
@ -134,12 +135,12 @@ public abstract class AbstractLuckPermsPlugin implements LuckPermsPlugin {
|
|||||||
this.configuration = new LuckPermsConfiguration(this, provideConfigurationAdapter());
|
this.configuration = new LuckPermsConfiguration(this, provideConfigurationAdapter());
|
||||||
|
|
||||||
// setup a bytebin instance
|
// setup a bytebin instance
|
||||||
OkHttpClient httpClient = new OkHttpClient.Builder()
|
this.httpClient = new OkHttpClient.Builder()
|
||||||
.callTimeout(15, TimeUnit.SECONDS)
|
.callTimeout(15, TimeUnit.SECONDS)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
this.bytebin = new BytebinClient(httpClient, getConfiguration().get(ConfigKeys.BYTEBIN_URL), "luckperms");
|
this.bytebin = new BytebinClient(this.httpClient, getConfiguration().get(ConfigKeys.BYTEBIN_URL), "luckperms");
|
||||||
this.bytesocks = new BytesocksClient(httpClient, getConfiguration().get(ConfigKeys.BYTESOCKS_HOST), "luckperms/editor");
|
this.bytesocks = new BytesocksClient(this.httpClient, getConfiguration().get(ConfigKeys.BYTESOCKS_HOST), "luckperms/editor");
|
||||||
this.webEditorStore = new WebEditorStore(this);
|
this.webEditorStore = new WebEditorStore(this);
|
||||||
|
|
||||||
// init translation repo and update bundle files
|
// init translation repo and update bundle files
|
||||||
@ -273,6 +274,10 @@ public abstract class AbstractLuckPermsPlugin implements LuckPermsPlugin {
|
|||||||
// shutdown async executor pool
|
// shutdown async executor pool
|
||||||
getBootstrap().getScheduler().shutdownExecutor();
|
getBootstrap().getScheduler().shutdownExecutor();
|
||||||
|
|
||||||
|
// shutdown okhttp
|
||||||
|
this.httpClient.dispatcher().executorService().shutdown();
|
||||||
|
this.httpClient.connectionPool().evictAll();
|
||||||
|
|
||||||
// close classpath appender
|
// close classpath appender
|
||||||
getBootstrap().getClassPathAppender().close();
|
getBootstrap().getClassPathAppender().close();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user