recurrents
This commit is contained in:
20
src/main/kotlin/space/luminic/finance/services/Scheduler.kt
Normal file
20
src/main/kotlin/space/luminic/finance/services/Scheduler.kt
Normal file
@@ -0,0 +1,20 @@
|
||||
package space.luminic.finance.services
|
||||
|
||||
import org.slf4j.LoggerFactory
|
||||
import org.springframework.scheduling.annotation.EnableScheduling
|
||||
import org.springframework.scheduling.annotation.Scheduled
|
||||
import org.springframework.stereotype.Service
|
||||
|
||||
@EnableScheduling
|
||||
@Service
|
||||
class Scheduler(
|
||||
private val recurrentOperationService: RecurrentOperationService
|
||||
) {
|
||||
private val log = LoggerFactory.getLogger(Scheduler::class.java)
|
||||
|
||||
@Scheduled(cron = "0 0 3 * * *")
|
||||
fun createRecurrentAfter13Month() {
|
||||
log.info("Creating recurrent after 13 month")
|
||||
recurrentOperationService.createRecurrentTransactions()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user