mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-06-30 17:34:39 -05:00
Feature/make config settings changeable during runtime (#545)
* Add logic to update config during runtime * Update ConfigModule to always use the latest config * Make ServerConfig settings re-assignable
This commit is contained in:
@@ -8,12 +8,12 @@ import xyz.nulldev.ts.config.ConfigModule
|
||||
* Application info config.
|
||||
*/
|
||||
|
||||
class ApplicationInfoConfigModule(config: Config) : ConfigModule(config) {
|
||||
val packageName: String by config
|
||||
val debug: Boolean by config
|
||||
class ApplicationInfoConfigModule(getConfig: () -> Config) : ConfigModule(getConfig) {
|
||||
val packageName: String by getConfig()
|
||||
val debug: Boolean by getConfig()
|
||||
|
||||
companion object {
|
||||
fun register(config: Config) =
|
||||
ApplicationInfoConfigModule(config.getConfig("android.app"))
|
||||
ApplicationInfoConfigModule { config.getConfig("android.app") }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user