1
0
mirror of https://gitlab.com/mangadex-pub/mangadex_at_home.git synced 2024-11-16 16:12:32 +01:00

Fix random arbitrary shutdown by using exceptions

This commit is contained in:
carbotaniuman 2020-09-01 12:00:18 -05:00
parent 9ce7eccb47
commit 21699acc25

View File

@ -5,6 +5,7 @@ import com.fasterxml.jackson.databind.ObjectMapper
import com.fasterxml.jackson.databind.SerializationFeature
import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper
import com.fasterxml.jackson.module.kotlin.readValue
import java.lang.RuntimeException
import java.time.Instant
import java.util.Collections
import java.util.LinkedHashMap
@ -145,7 +146,7 @@ class ServerManager(serverSettings: ServerSettings, devSettings: DevSettings, ma
}
}
} catch (e: Exception) {
LOGGER.warn(e) { "Main loop failed" }
LOGGER.error(e) { "Main loop failed" }
}
}, 15, 15, TimeUnit.SECONDS)
@ -199,7 +200,8 @@ class ServerManager(serverSettings: ServerSettings, devSettings: DevSettings, ma
val state = this.state as Uninitialized
val remoteSettings = serverHandler.loginToControl()
?: Main.dieWithError("Failed to get a login response from server - check API secret for validity")
?: throw RuntimeException("Failed to get a login response from server")
val server = getServer(cache, database, remoteSettings, state.serverSettings, statistics, isHandled).start()
if (remoteSettings.latestBuild > Constants.CLIENT_BUILD) {