Impose 15 second timeout on all http calls (#2436)

This commit is contained in:
Luck 2020-07-16 20:15:53 +01:00
parent 0fd7f643a7
commit cd0fd80b33
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -119,7 +119,11 @@ public abstract class AbstractLuckPermsPlugin implements LuckPermsPlugin {
this.localeManager.tryLoad(this, getBootstrap().getConfigDirectory().resolve("lang.yml"));
// setup a bytebin instance
this.bytebin = new BytebinClient(new OkHttpClient(), getConfiguration().get(ConfigKeys.BYTEBIN_URL), "luckperms");
OkHttpClient httpClient = new OkHttpClient.Builder()
.callTimeout(15, TimeUnit.SECONDS)
.build();
this.bytebin = new BytebinClient(httpClient, getConfiguration().get(ConfigKeys.BYTEBIN_URL), "luckperms");
// now the configuration is loaded, we can create a storage factory and load initial dependencies
StorageFactory storageFactory = new StorageFactory(this);