diff --git a/src/main/kotlin/org/athmer/k8s/scheduler/Job.kt b/src/main/kotlin/org/athmer/k8s/scheduler/Job.kt new file mode 100644 index 0000000..523fd59 --- /dev/null +++ b/src/main/kotlin/org/athmer/k8s/scheduler/Job.kt @@ -0,0 +1,16 @@ +package org.athmer.k8s.scheduler + +import org.slf4j.LoggerFactory +import org.springframework.scheduling.annotation.Scheduled +import org.springframework.stereotype.Component + +@Component +class Job { + + val logger = LoggerFactory.getLogger(this::class.java) + + @Scheduled(fixedRate = 1000) + fun log() { + logger.info("Job started") + } +} \ No newline at end of file diff --git a/src/main/kotlin/org/athmer/k8s/scheduler/SchedulerApplication.kt b/src/main/kotlin/org/athmer/k8s/scheduler/SchedulerApplication.kt index 22077c1..eba8c7f 100644 --- a/src/main/kotlin/org/athmer/k8s/scheduler/SchedulerApplication.kt +++ b/src/main/kotlin/org/athmer/k8s/scheduler/SchedulerApplication.kt @@ -2,8 +2,10 @@ package org.athmer.k8s.scheduler import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.runApplication +import org.springframework.scheduling.annotation.EnableScheduling @SpringBootApplication +@EnableScheduling class SchedulerApplication fun main(args: Array) {