shutdown thread pool

pull/490/head
DerekYRC 3 years ago
parent f8e6780695
commit 91fbac9b6a

@ -38,6 +38,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.cloud.client.serviceregistry.Registration;
import org.springframework.cloud.client.serviceregistry.ServiceRegistry;
@ -49,7 +50,7 @@ import static org.springframework.util.ReflectionUtils.rethrowRuntimeException;
*
* @author Haotian Zhang, Andrew Shan, Jie Cheng
*/
public class PolarisServiceRegistry implements ServiceRegistry<Registration> {
public class PolarisServiceRegistry implements ServiceRegistry<Registration>, DisposableBean {
private static final Logger LOGGER = LoggerFactory.getLogger(PolarisServiceRegistry.class);
@ -216,4 +217,9 @@ public class PolarisServiceRegistry implements ServiceRegistry<Registration> {
}
}, polarisDiscoveryProperties.getHeartbeatInterval(), polarisDiscoveryProperties.getHeartbeatInterval(), MILLISECONDS);
}
@Override
public void destroy() throws Exception {
heartbeatExecutor.shutdown();
}
}

Loading…
Cancel
Save