From f02c47ca1ff3a3152cf213211e1f8a0e96ed7817 Mon Sep 17 00:00:00 2001 From: carbotaniuman <41451839+carbotaniuman@users.noreply.github.com> Date: Fri, 19 Jun 2020 15:37:21 -0500 Subject: [PATCH] Adjust logback graceful close --- src/main/java/mdnet/base/MangaDexClient.java | 5 ++++- src/main/resources/logback.xml | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/mdnet/base/MangaDexClient.java b/src/main/java/mdnet/base/MangaDexClient.java index d1c1539..b9cd1d9 100644 --- a/src/main/java/mdnet/base/MangaDexClient.java +++ b/src/main/java/mdnet/base/MangaDexClient.java @@ -1,5 +1,6 @@ package mdnet.base; +import ch.qos.logback.classic.LoggerContext; import mdnet.base.settings.ClientSettings; import mdnet.base.server.ApplicationKt; import mdnet.base.server.WebUiKt; @@ -262,10 +263,12 @@ public class MangaDexClient { } catch (IOException e) { LOGGER.error("Cache failed to close", e); } - executorService.shutdown(); readyToExit.set(true); }; while (!readyToExit.get()) { } + executorService.shutdown(); + LoggerContext loggerContext = (LoggerContext) LoggerFactory.getILoggerFactory(); + loggerContext.stop(); } } diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml index 3f73e0a..1fbc123 100644 --- a/src/main/resources/logback.xml +++ b/src/main/resources/logback.xml @@ -1,6 +1,4 @@ - - false