shutdown thread pool

pull/489/head
DerekYRC 3 years ago
parent 7a257be3ed
commit ad3487db3e

@ -38,6 +38,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.cloud.client.serviceregistry.Registration; import org.springframework.cloud.client.serviceregistry.Registration;
import org.springframework.cloud.client.serviceregistry.ServiceRegistry; 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 * @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); private static final Logger log = LoggerFactory.getLogger(PolarisServiceRegistry.class);
@ -218,4 +219,9 @@ public class PolarisServiceRegistry implements ServiceRegistry<Registration> {
} }
}, polarisDiscoveryProperties.getHeartbeatInterval(), polarisDiscoveryProperties.getHeartbeatInterval(), MILLISECONDS); }, polarisDiscoveryProperties.getHeartbeatInterval(), polarisDiscoveryProperties.getHeartbeatInterval(), MILLISECONDS);
} }
@Override
public void destroy() throws Exception {
heartbeatExecutor.shutdown();
}
} }

Loading…
Cancel
Save