fix(komga-tray): some tasks would not be run on startup

This commit is contained in:
Gauthier Roebroeck 2023-10-18 16:20:06 +08:00
parent f2f25088be
commit a47eddbbac
2 changed files with 8 additions and 1 deletions

View file

@ -1,12 +1,16 @@
package org.gotson.komga
import org.springframework.boot.builder.SpringApplicationBuilder
import org.springframework.scheduling.annotation.EnableAsync
@EnableAsync
class DesktopApplication : Application()
fun main(args: Array<String>) {
System.setProperty("apple.awt.UIElement", "true")
System.setProperty("org.jooq.no-logo", "true")
System.setProperty("org.jooq.no-tips", "true")
val builder = SpringApplicationBuilder(Application::class.java)
val builder = SpringApplicationBuilder(DesktopApplication::class.java)
builder.headless(false)
builder.run(*args)
}

View file

@ -12,6 +12,7 @@ import org.springframework.boot.ApplicationRunner
import org.springframework.context.annotation.Profile
import org.springframework.core.env.Environment
import org.springframework.core.io.ClassPathResource
import org.springframework.scheduling.annotation.Async
import org.springframework.stereotype.Component
import java.io.File
@ -29,6 +30,8 @@ class TrayIconRunner(
val komgaConfigDir = File(komgaConfigDir)
val logFile = File(logFileName)
val iconFileName = if (env.activeProfiles.contains("mac")) "komga-gray-minimal.svg" else "komga-color.svg"
@Async
override fun run(args: ApplicationArguments) {
runTray()
}