shutdown thread pool

pull/488/head
DerekYRC 3 years ago
parent a91a3805bc
commit 6363c2223d

@ -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 LOG = 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