From 3a009407ad16fca792a16008e1b1288229dc94ed Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Sat, 2 Jul 2022 13:32:20 +0100 Subject: [PATCH] Run server on new thread. (#297) --- src/main/java/me/kavin/piped/Main.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/kavin/piped/Main.java b/src/main/java/me/kavin/piped/Main.java index 79bd6fd..592c097 100644 --- a/src/main/java/me/kavin/piped/Main.java +++ b/src/main/java/me/kavin/piped/Main.java @@ -42,7 +42,13 @@ public class Main { } }, 0, TimeUnit.MINUTES.toMillis(60)); - new ServerLauncher().launch(args); + new Thread(() -> { + try { + new ServerLauncher().launch(args); + } catch (Exception e) { + throw new RuntimeException(e); + } + }).start(); if (Constants.DISABLE_TIMERS) return;