Skip to content

Commit

Permalink
Remove conditional activation property from controller, task and mani…
Browse files Browse the repository at this point in the history
…fest
  • Loading branch information
pacphi committed Mar 15, 2024
1 parent b50233c commit 2e71130
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
1 change: 0 additions & 1 deletion manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.+ } }'
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
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;

import reactor.core.publisher.Mono;

@RestController
@ConditionalOnProperty(prefix="cron", name="enabled", havingValue="true")
public class MetricCacheRefreshController {

private final MetricCacheRefreshTask task;
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit 2e71130

Please sign in to comment.