diff --git a/.gitignore b/.gitignore index 2fdb81c..69a436c 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,5 @@ bin/ .metadata tmp/ /.apt_generated_tests/ -.DS_Store \ No newline at end of file +.DS_Store +.idea \ No newline at end of file diff --git a/src/main/java/it/finanze/sanita/fse2/ms/gtw/statusmanager/controller/impl/SchedulerActionCTL.java b/src/main/java/it/finanze/sanita/fse2/ms/gtw/statusmanager/controller/impl/SchedulerActionCTL.java index bd96211..7700fa1 100644 --- a/src/main/java/it/finanze/sanita/fse2/ms/gtw/statusmanager/controller/impl/SchedulerActionCTL.java +++ b/src/main/java/it/finanze/sanita/fse2/ms/gtw/statusmanager/controller/impl/SchedulerActionCTL.java @@ -13,12 +13,14 @@ import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; import org.springframework.web.bind.annotation.RestController; import it.finanze.sanita.fse2.ms.gtw.statusmanager.controller.ISchedulerActionCTL; import it.finanze.sanita.fse2.ms.gtw.statusmanager.scheduler.TxScheduler; @RestController +@ConditionalOnExpression("'${scheduler.tx-scheduler}'!='-'") public class SchedulerActionCTL extends AbstractCTL implements ISchedulerActionCTL{ diff --git a/src/main/java/it/finanze/sanita/fse2/ms/gtw/statusmanager/scheduler/TxScheduler.java b/src/main/java/it/finanze/sanita/fse2/ms/gtw/statusmanager/scheduler/TxScheduler.java index 71ffd0c..dc1245f 100644 --- a/src/main/java/it/finanze/sanita/fse2/ms/gtw/statusmanager/scheduler/TxScheduler.java +++ b/src/main/java/it/finanze/sanita/fse2/ms/gtw/statusmanager/scheduler/TxScheduler.java @@ -15,6 +15,7 @@ import lombok.extern.slf4j.Slf4j; import net.javacrumbs.shedlock.spring.annotation.SchedulerLock; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; @@ -24,6 +25,7 @@ @Slf4j @Component +@ConditionalOnExpression("'${scheduler.tx-scheduler}'!='-'") public class TxScheduler { @Autowired