From 2e7113095b2bad88dfcfcdf0150284bd00d7a47a Mon Sep 17 00:00:00 2001 From: Chris Phillipson Date: Fri, 15 Mar 2024 08:01:19 -0700 Subject: [PATCH] Remove conditional activation property from controller, task and manifest --- manifest.yml | 1 - .../pivotal/cfapp/task/MetricCacheRefreshController.java | 2 -- .../io/pivotal/cfapp/task/MetricCacheRefreshTask.java | 8 +++----- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/manifest.yml b/manifest.yml index da61a1c..d75ca87 100644 --- a/manifest.yml +++ b/manifest.yml @@ -6,7 +6,6 @@ applications: path: target/cf-hoover-ui-1.0-SNAPSHOT.jar instances: 1 env: - CRON_ENABLED: true JAVA_OPTS: -Djava.security.egd=file:///dev/urandom SPRING_PROFILES_ACTIVE: cloud JBP_CONFIG_OPEN_JDK_JRE: '{ jre: { version: 21.+ } }' diff --git a/src/main/java/io/pivotal/cfapp/task/MetricCacheRefreshController.java b/src/main/java/io/pivotal/cfapp/task/MetricCacheRefreshController.java index 398143e..a0b594e 100644 --- a/src/main/java/io/pivotal/cfapp/task/MetricCacheRefreshController.java +++ b/src/main/java/io/pivotal/cfapp/task/MetricCacheRefreshController.java @@ -1,7 +1,6 @@ package io.pivotal.cfapp.task; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RestController; @@ -9,7 +8,6 @@ import reactor.core.publisher.Mono; @RestController -@ConditionalOnProperty(prefix="cron", name="enabled", havingValue="true") public class MetricCacheRefreshController { private final MetricCacheRefreshTask task; diff --git a/src/main/java/io/pivotal/cfapp/task/MetricCacheRefreshTask.java b/src/main/java/io/pivotal/cfapp/task/MetricCacheRefreshTask.java index d0cf084..26e6d99 100644 --- a/src/main/java/io/pivotal/cfapp/task/MetricCacheRefreshTask.java +++ b/src/main/java/io/pivotal/cfapp/task/MetricCacheRefreshTask.java @@ -1,22 +1,20 @@ package io.pivotal.cfapp.task; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.ApplicationArguments; import org.springframework.boot.ApplicationRunner; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + import io.pivotal.cfapp.client.HooverClient; import io.pivotal.cfapp.repository.MetricCache; import lombok.extern.slf4j.Slf4j; @Slf4j @Component -@ConditionalOnProperty(prefix="cron", name="enabled", havingValue="true") public class MetricCacheRefreshTask implements ApplicationRunner { private final HooverClient hooverClient;