Skip to content

Commit

Permalink
Fix Updater (#742)
Browse files Browse the repository at this point in the history
  • Loading branch information
Syer10 authored Oct 29, 2023
1 parent 7659523 commit 1c192b8
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import org.bouncycastle.jce.provider.BouncyCastleProvider
import org.kodein.di.DI
import org.kodein.di.bind
import org.kodein.di.conf.global
import org.kodein.di.instance
import org.kodein.di.singleton
import suwayomi.tachidesk.manga.impl.backup.proto.ProtoBackupExport
import suwayomi.tachidesk.manga.impl.download.DownloadManager
Expand Down Expand Up @@ -109,12 +110,10 @@ fun applicationSetup() {
"Loaded config:\n" + GlobalConfigManager.config.root().render(ConfigRenderOptions.concise().setFormatted(true))
}

val updater = Updater()

DI.global.addImport(
DI.Module("Server") {
bind<ApplicationDirs>() with singleton { applicationDirs }
bind<IUpdater>() with singleton { updater }
bind<IUpdater>() with singleton { Updater() }
bind<JsonMapper>() with singleton { JavalinJackson() }
bind<Json>() with singleton { Json { ignoreUnknownKeys = true } }
},
Expand Down Expand Up @@ -253,7 +252,8 @@ fun applicationSetup() {
Security.addProvider(BouncyCastleProvider())

// start automated global updates
updater.scheduleUpdateTask()
val updater by DI.global.instance<IUpdater>()
(updater as Updater).scheduleUpdateTask()

// start automated backups
ProtoBackupExport.scheduleAutomatedBackupTask()
Expand Down

0 comments on commit 1c192b8

Please sign in to comment.