refactor: use @Component instead of @Controller for schedulers

This commit is contained in:
Gauthier Roebroeck 2020-06-15 09:39:40 +08:00
parent 374f39d76c
commit 5a30f0ffe1
3 changed files with 6 additions and 6 deletions

View file

@ -9,12 +9,12 @@ import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.Profile import org.springframework.context.annotation.Profile
import org.springframework.context.event.EventListener import org.springframework.context.event.EventListener
import org.springframework.stereotype.Controller import org.springframework.stereotype.Component
private val logger = KotlinLogging.logger {} private val logger = KotlinLogging.logger {}
@Profile("!(test | claim)") @Profile("!(test | claim)")
@Controller @Component
class InitialUserController( class InitialUserController(
private val userLifecycle: KomgaUserLifecycle, private val userLifecycle: KomgaUserLifecycle,
private val initialUsers: List<KomgaUser> private val initialUsers: List<KomgaUser>

View file

@ -7,12 +7,12 @@ import org.springframework.boot.context.event.ApplicationReadyEvent
import org.springframework.context.annotation.Profile import org.springframework.context.annotation.Profile
import org.springframework.context.event.EventListener import org.springframework.context.event.EventListener
import org.springframework.scheduling.annotation.Scheduled import org.springframework.scheduling.annotation.Scheduled
import org.springframework.stereotype.Controller import org.springframework.stereotype.Component
private val logger = KotlinLogging.logger {} private val logger = KotlinLogging.logger {}
@Profile("!test") @Profile("!test")
@Controller @Component
class PeriodicDatabaseBackupController( class PeriodicDatabaseBackupController(
private val taskReceiver: TaskReceiver, private val taskReceiver: TaskReceiver,
private val komgaProperties: KomgaProperties private val komgaProperties: KomgaProperties

View file

@ -6,12 +6,12 @@ import org.springframework.boot.context.event.ApplicationReadyEvent
import org.springframework.context.annotation.Profile import org.springframework.context.annotation.Profile
import org.springframework.context.event.EventListener import org.springframework.context.event.EventListener
import org.springframework.scheduling.annotation.Scheduled import org.springframework.scheduling.annotation.Scheduled
import org.springframework.stereotype.Controller import org.springframework.stereotype.Component
private val logger = KotlinLogging.logger {} private val logger = KotlinLogging.logger {}
@Profile("!test") @Profile("!test")
@Controller @Component
class PeriodicScannerController( class PeriodicScannerController(
private val taskReceiver: TaskReceiver private val taskReceiver: TaskReceiver
) { ) {