File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed
kotlin/com/softeno/template/sample/scheduled Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -3,13 +3,19 @@ package com.softeno.template.sample.scheduled
33import com.softeno.template.sample.http.internal.async.AsyncService
44import org.apache.commons.logging.LogFactory
55import org.springframework.beans.factory.annotation.Qualifier
6+ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
67import org.springframework.context.annotation.Profile
78import org.springframework.scheduling.annotation.Scheduled
89import org.springframework.stereotype.Service
910import java.util.concurrent.Executor
1011import java.util.concurrent.TimeUnit
1112
1213@Profile(value = [" !integration" ])
14+ @ConditionalOnProperty(
15+ name = [" com.softeno.scheduled-tasks" ],
16+ havingValue = " true" ,
17+ matchIfMissing = false
18+ )
1319@Service
1420class ScheduledService (
1521 @Qualifier(value = " scheduledExecutor" ) private val executor : Executor ,
@@ -33,7 +39,6 @@ class ScheduledService(
3339
3440 }
3541
36- // cron: every 10m
3742 @Scheduled(cron = " 0 * */12 * * *" )
3843 fun periodicTaskCron () {
3944 log.info(" [scheduled]: periodic task cron start" )
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ spring.kafka.properties.spring.json.trusted.packages=*
2626spring.kafka.consumer.properties.spring.json.use.type.headers =false
2727spring.kafka.consumer.properties.spring.json.value.default.type =com.fasterxml.jackson.databind.JsonNode
2828
29+ com.softeno.scheduled-tasks =false
2930com.softeno.kafka.tx =${KAFKA_TOPIC_TX}
3031com.softeno.kafka.rx =${KAFKA_TOPIC_RX}
3132com.softeno.kafka.keycloak =${KAFKA_KEYCLOAK}
Original file line number Diff line number Diff line change 7878 <appender-ref ref =" Console" />
7979 <appender-ref ref =" logstash" />
8080 </root >
81- <logger name =" com.softeno" level =" debug " additivity =" false" >
81+ <logger name =" com.softeno" level =" info " additivity =" false" >
8282 <appender-ref ref =" Console" />
8383 <appender-ref ref =" RollingFile" />
8484 <appender-ref ref =" logstash" />
You can’t perform that action at this time.
0 commit comments