Prevent async task pool from being full (#2894)

Fixes #2883
This commit is contained in:
Hancho1577 2022-03-19 20:45:19 +07:00 committed by GitHub
parent 732fd90d48
commit b81ad3f0db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -601,6 +601,8 @@ public class SkinProvider {
HttpURLConnection con = (HttpURLConnection) new URL(imageUrl).openConnection();
con.setRequestProperty("User-Agent", "Geyser-" + GeyserImpl.getInstance().getPlatformType().toString() + "/" + GeyserImpl.VERSION);
con.setConnectTimeout(10000);
con.setReadTimeout(10000);
BufferedImage image = ImageIO.read(con.getInputStream());
if (image == null) throw new NullPointerException();

View file

@ -52,6 +52,8 @@ public class WebUtils {
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("User-Agent", "Geyser-" + GeyserImpl.getInstance().getPlatformType().toString() + "/" + GeyserImpl.VERSION); // Otherwise Java 8 fails on checking updates
con.setConnectTimeout(10000);
con.setReadTimeout(10000);
return connectionToString(con);
} catch (Exception e) {