From 309a37a26b210f04d97aa72cc114be1d95cc6dc1 Mon Sep 17 00:00:00 2001 From: PinkGoosik Date: Sun, 23 Jul 2023 17:54:12 +0500 Subject: [PATCH] ignore connection timed out --- src/main/java/ru/pinkgoosik/kitsun/api/mojang/MojangAPI.java | 4 ++++ src/main/java/ru/pinkgoosik/kitsun/schedule/Scheduler.java | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/ru/pinkgoosik/kitsun/api/mojang/MojangAPI.java b/src/main/java/ru/pinkgoosik/kitsun/api/mojang/MojangAPI.java index 1e86dfe..cac2cc0 100644 --- a/src/main/java/ru/pinkgoosik/kitsun/api/mojang/MojangAPI.java +++ b/src/main/java/ru/pinkgoosik/kitsun/api/mojang/MojangAPI.java @@ -6,6 +6,7 @@ import ru.pinkgoosik.kitsun.util.UrlParser; import java.io.InputStreamReader; +import java.net.ConnectException; import java.net.URL; import java.net.URLConnection; import java.util.ArrayList; @@ -21,6 +22,9 @@ public static Optional getManifest() { try { return Optional.of(UrlParser.get(MANIFEST, VersionManifest.class)); } + catch(ConnectException e) { + return Optional.empty(); + } catch(Exception e) { KitsunDebugger.report("Failed to parse minecraft versions manifest due to an exception:\n" + e); } diff --git a/src/main/java/ru/pinkgoosik/kitsun/schedule/Scheduler.java b/src/main/java/ru/pinkgoosik/kitsun/schedule/Scheduler.java index 0a18c1e..6da08fb 100644 --- a/src/main/java/ru/pinkgoosik/kitsun/schedule/Scheduler.java +++ b/src/main/java/ru/pinkgoosik/kitsun/schedule/Scheduler.java @@ -11,7 +11,6 @@ public static void start() { timer.schedule(new TimerTask() { @Override public void run() { - KitsunDebugger.CACHE.clear(); MCUpdatesScheduler.schedule(); } }, 0, 5 * (60 * 1000));