Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import dev.vml.es.acm.core.osgi.OsgiScanner;
import dev.vml.es.acm.core.osgi.OsgiUtils;
import dev.vml.es.acm.core.repo.Repo;
import dev.vml.es.acm.core.script.ScriptType;
import dev.vml.es.acm.core.util.ExceptionUtils;
import dev.vml.es.acm.core.util.ResolverUtils;
import java.util.*;
Expand All @@ -18,7 +19,6 @@
import org.apache.commons.lang3.StringUtils;
import org.apache.sling.api.resource.ResourceResolver;
import org.apache.sling.api.resource.ResourceResolverFactory;
import org.apache.sling.discovery.DiscoveryService;
import org.osgi.framework.Bundle;
import org.osgi.framework.FrameworkUtil;
import org.osgi.framework.ServiceRegistration;
Expand Down Expand Up @@ -53,9 +53,6 @@ public class HealthChecker implements EventHandler {
@Reference
private SlingInstaller slingInstaller;

@Reference
private DiscoveryService discoveryService;

private Config config;

private ServiceRegistration<EventHandler> eventHandlerRegistration;
Expand Down Expand Up @@ -131,6 +128,14 @@ private void checkRepository(List<HealthIssue> issues, ResourceResolver resource
"Composite node store not available",
null));
}
if (Arrays.stream(ScriptType.values())
.anyMatch(st -> !repo.get(st.root()).exists())) {
issues.add(new HealthIssue(
HealthIssueSeverity.CRITICAL,
HealthIssueCategory.INSTANCE,
"Restart required: repo-init not yet executed",
null));
}
if (ArrayUtils.isNotEmpty(config.repositoryPathsExisted())) {
Arrays.stream(config.repositoryPathsExisted()).forEach(path -> {
if (!repo.get(path).exists()) {
Expand Down