Skip to content
This repository has been archived by the owner on Jun 3, 2024. It is now read-only.

Add a possibility to wire a health check executor #92

Open
wants to merge 1 commit into
base: v3.0-maintenance
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.ryantenney.metrics</groupId>
<artifactId>metrics-spring</artifactId>
<version>3.0.3</version>
<version>3.0.4</version>
<packaging>bundle</packaging>
<name>Metrics Spring Integration</name>
<description>Spring integration for Coda Hale's Metrics Library</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package com.ryantenney.metrics.spring.servlets;

import java.util.concurrent.ExecutorService;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

Expand All @@ -34,6 +35,9 @@ public class MetricsServletsContextListener implements ServletContextListener {
@Autowired
private HealthCheckRegistry healthCheckRegistry;

@Autowired(required = false)
private ExecutorService healthChecksExecutorService;

private final MetricsServletContextListener metricsServletContextListener = new MetricsServletContextListener();
private final HealthCheckServletContextListener healthCheckServletContextListener = new HealthCheckServletContextListener();

Expand Down Expand Up @@ -64,6 +68,14 @@ protected HealthCheckRegistry getHealthCheckRegistry() {
return healthCheckRegistry;
}

}
@Override
protected ExecutorService getExecutorService() {
if (healthChecksExecutorService != null) {
return healthChecksExecutorService;
} else {
return super.getExecutorService();
}
}
}

}