ionutzpi commented on code in PR #41:
URL: 
https://github.com/apache/sling-org-apache-sling-event/pull/41#discussion_r2041868572


##########
src/main/java/org/apache/sling/event/impl/jobs/JobManagerImpl.java:
##########
@@ -777,4 +805,39 @@ public Job retryJobById(final String jobId) {
     public JobSchedulerImpl getJobScheduler() {
         return this.jobScheduler;
     }
+
+    /**
+     * Check the health status of the system by executing health checks with 
the configured tag
+     */
+    private void checkHealthStatus() {
+        try {
+            // Execute health checks with the configured tag
+            List<HealthCheckExecutionResult> results = healthCheckExecutor != 
null
+                    ? 
healthCheckExecutor.execute(HealthCheckSelector.tags("sling"))
+                    : null;
+
+            if (results == null || results.isEmpty()) {
+                isHealthy = false;
+                logger.warn("No health check results available. Marking system 
as unhealthy.");
+                return;
+            }
+
+            // Consider the system healthy only if all health checks pass
+            isHealthy = results.stream()
+                    .filter(result -> result != null && 
result.getHealthCheckResult() != null)
+                    .allMatch(result -> 
result.getHealthCheckResult().getStatus() == Result.Status.OK);
+
+            if (!isHealthy) {
+                logger.warn("System health check failed. Results: {}",

Review Comment:
   Remove changes



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@sling.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to