|
9 | 9 | import dev.vml.es.acm.core.osgi.OsgiScanner; |
10 | 10 | import dev.vml.es.acm.core.osgi.OsgiUtils; |
11 | 11 | import dev.vml.es.acm.core.repo.Repo; |
| 12 | +import dev.vml.es.acm.core.script.ScriptType; |
12 | 13 | import dev.vml.es.acm.core.util.ExceptionUtils; |
13 | 14 | import dev.vml.es.acm.core.util.ResolverUtils; |
14 | 15 | import java.util.*; |
|
18 | 19 | import org.apache.commons.lang3.StringUtils; |
19 | 20 | import org.apache.sling.api.resource.ResourceResolver; |
20 | 21 | import org.apache.sling.api.resource.ResourceResolverFactory; |
21 | | -import org.apache.sling.discovery.DiscoveryService; |
22 | 22 | import org.osgi.framework.Bundle; |
23 | 23 | import org.osgi.framework.FrameworkUtil; |
24 | 24 | import org.osgi.framework.ServiceRegistration; |
@@ -53,9 +53,6 @@ public class HealthChecker implements EventHandler { |
53 | 53 | @Reference |
54 | 54 | private SlingInstaller slingInstaller; |
55 | 55 |
|
56 | | - @Reference |
57 | | - private DiscoveryService discoveryService; |
58 | | - |
59 | 56 | private Config config; |
60 | 57 |
|
61 | 58 | private ServiceRegistration<EventHandler> eventHandlerRegistration; |
@@ -131,6 +128,14 @@ private void checkRepository(List<HealthIssue> issues, ResourceResolver resource |
131 | 128 | "Composite node store not available", |
132 | 129 | null)); |
133 | 130 | } |
| 131 | + if (Arrays.stream(ScriptType.values()) |
| 132 | + .anyMatch(st -> !repo.get(st.root()).exists())) { |
| 133 | + issues.add(new HealthIssue( |
| 134 | + HealthIssueSeverity.CRITICAL, |
| 135 | + HealthIssueCategory.INSTANCE, |
| 136 | + "Restart required: repo-init not yet executed", |
| 137 | + null)); |
| 138 | + } |
134 | 139 | if (ArrayUtils.isNotEmpty(config.repositoryPathsExisted())) { |
135 | 140 | Arrays.stream(config.repositoryPathsExisted()).forEach(path -> { |
136 | 141 | if (!repo.get(path).exists()) { |
|
0 commit comments