From 22fc42e7bc79960763e0c7e764c8c9349f3c03f3 Mon Sep 17 00:00:00 2001 From: carbotaniuman <41451839+carbotaniuman@users.noreply.github.com> Date: Sat, 27 Jun 2020 12:26:29 -0500 Subject: [PATCH] Fix state transition bug --- src/main/kotlin/mdnet/base/MangaDexClient.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/mdnet/base/MangaDexClient.kt b/src/main/kotlin/mdnet/base/MangaDexClient.kt index 3b2da5b..aac30e9 100644 --- a/src/main/kotlin/mdnet/base/MangaDexClient.kt +++ b/src/main/kotlin/mdnet/base/MangaDexClient.kt @@ -190,12 +190,12 @@ class MangaDexClient(private val clientSettings: ClientSettings) { LOGGER.info("Shutting down server as hourly bandwidth limit reached") } this.state = GracefulShutdown(lastRunning = state) + } else { + pingControl() } - - pingControl() } } catch (e: Exception) { - LOGGER.warn("Main loop failed", e) + LOGGER.warn("Graceful shutdown checker failed", e) } }, 45, 45, TimeUnit.SECONDS) }