mirror of
https://gitlab.com/mangadex-pub/mangadex_at_home.git
synced 2024-01-19 02:48:37 +00:00
Update settings beforehand
This commit is contained in:
parent
b1ed017bfd
commit
12ac127569
|
@ -170,6 +170,7 @@ class MangaDexClient(private val settingsFile: File, databaseFile: File, cacheFo
|
||||||
LOGGER.info { "Client settings unchanged" }
|
LOGGER.info { "Client settings unchanged" }
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
settings = newSettings
|
||||||
LOGGER.info { "New settings loaded: $newSettings" }
|
LOGGER.info { "New settings loaded: $newSettings" }
|
||||||
|
|
||||||
storage.maxSize = (newSettings.maxCacheSizeInMebibytes * 1024 * 1024 * 0.95).toLong()
|
storage.maxSize = (newSettings.maxCacheSizeInMebibytes * 1024 * 1024 * 0.95).toLong()
|
||||||
|
@ -177,7 +178,6 @@ class MangaDexClient(private val settingsFile: File, databaseFile: File, cacheFo
|
||||||
stopImageServer()
|
stopImageServer()
|
||||||
startImageServer()
|
startImageServer()
|
||||||
|
|
||||||
settings = newSettings
|
|
||||||
} catch (e: UnrecognizedPropertyException) {
|
} catch (e: UnrecognizedPropertyException) {
|
||||||
LOGGER.warn { "Settings file is invalid: '$e.propertyName' is not a valid setting" }
|
LOGGER.warn { "Settings file is invalid: '$e.propertyName' is not a valid setting" }
|
||||||
} catch (e: JsonProcessingException) {
|
} catch (e: JsonProcessingException) {
|
||||||
|
|
Loading…
Reference in a new issue