diff --git a/src/main/java/org/eclipsefoundation/adopters/service/impl/DefaultAdopterService.java b/src/main/java/org/eclipsefoundation/adopters/service/impl/DefaultAdopterService.java index 3c25744544f69c1e3ad79e986d402befcb4876f4..663252f739e64a4132b3d98df7c71395fecd9445 100644 --- a/src/main/java/org/eclipsefoundation/adopters/service/impl/DefaultAdopterService.java +++ b/src/main/java/org/eclipsefoundation/adopters/service/impl/DefaultAdopterService.java @@ -61,12 +61,8 @@ import io.quarkus.runtime.Startup; public class DefaultAdopterService implements AdopterService { private static final Logger LOGGER = LoggerFactory.getLogger(DefaultAdopterService.class); - @ConfigProperty(name = "eclipse.adopters.path.json", defaultValue = "/tmp/quarkus/adopters.json") - Path adoptersLocation; - @ConfigProperty(name = "eclipse.adopters.retry.count", defaultValue = "3") - int retryCount; - @ConfigProperty(name = "eclipse.adopters.retry.timeoutInMS", defaultValue = "1000") - long retryTimeout; + @ConfigProperty(name = "eclipse.project-adopters.adopters.filepath", defaultValue = "/tmp/quarkus/adopters.json") + Path adoptersFilepath; @Inject ObjectMapper objectMapper; @@ -83,14 +79,14 @@ public class DefaultAdopterService implements AdopterService { public void init() throws IOException { setAdopters(Collections.emptyList()); // attempt to ensure that the base directory exists for watching - Path parentDir = adoptersLocation.getParent(); + Path parentDir = adoptersFilepath.getParent(); if (!Files.exists(parentDir)) { Files.createDirectory(parentDir); } // read in the initial file if it exists - if (Files.exists(adoptersLocation)) { - LOGGER.debug("Found an adopters file at path {}, reading in", adoptersLocation); - List<Adopter> initialAdopters = readInAdopters(adoptersLocation, objectMapper); + if (Files.exists(adoptersFilepath)) { + LOGGER.debug("Found an adopters file at path {}, reading in", adoptersFilepath); + List<Adopter> initialAdopters = readInAdopters(adoptersFilepath, objectMapper); if (initialAdopters != null) { setAdopters(initialAdopters); @@ -133,7 +129,7 @@ public class DefaultAdopterService implements AdopterService { // pass a filtered list of events to be processed key.pollEvents().stream().filter(e -> e.kind() != OVERFLOW && e.kind().type() == Path.class) .map(e -> (WatchEvent<Path>) e) - .filter(e -> ((Path) e.context()).getFileName().equals(adoptersLocation.getFileName())) + .filter(e -> ((Path) e.context()).getFileName().equals(adoptersFilepath.getFileName())) .forEach(this::processEvent); } catch (@SuppressWarnings("java:S2142") InterruptedException e) { LOGGER.debug("Ending watch services, as thread was interrupted and closing"); @@ -161,7 +157,7 @@ public class DefaultAdopterService implements AdopterService { } else { // indicates an update or created file on the given // retrieve the new adopters and set them if the read operation was successful - List<Adopter> newAdopters = readInAdopters(adoptersLocation, objectMapper); + List<Adopter> newAdopters = readInAdopters(adoptersFilepath, objectMapper); if (newAdopters != null) { setAdopters(newAdopters); } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 1e85c0ab6e458ac6334eafcf5fe4ff79e743c17b..3da2cf884a13eb40f116b07b2ca16fef605f1d0e 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,15 +1,17 @@ -org.eclipsefoundation.adopters.api.ProjectsAPI/mp-rest/url=https://projects.eclipse.org - -## OAUTH CONFIG quarkus.http.root-path=/adopters +quarkus.log.level=INFO ## CORS settings quarkus.http.cors=false -quarkus.log.level=INFO +## OIDC settings quarkus.oidc.enabled=false -## Adopters raw location -eclipse.adopters.path.json=/config/adopters.json -%dev.eclipse.adopters.path.json=/tmp/config/adopters.json +# Projects-API +org.eclipsefoundation.adopters.api.ProjectsAPI/mp-rest/url=https://projects.eclipse.org + +## Adopters settings +eclipse.project-adopters.adopters.filepath=/config/adopters.json +%dev.eclipse.project-adopters.adopters.filepath=/tmp/config/adopters.json + %dev.eclipse.pagination.scheme.enforce=false