fix: shutdown thread pool before the container closes

pull/353/head
DerekYRC 3 years ago
parent 34e4c70e8f
commit e3c5d6c916

@ -31,6 +31,8 @@ import org.springframework.context.ApplicationEventPublisher;
import org.springframework.context.ApplicationEventPublisherAware;
import org.springframework.context.ApplicationListener;
import javax.annotation.PreDestroy;
import static com.tencent.cloud.polaris.discovery.refresh.PolarisServiceStatusChangeListener.INDEX;
/**
@ -83,4 +85,9 @@ public class PolarisRefreshApplicationReadyEventListener implements ApplicationL
public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
this.publisher = applicationEventPublisher;
}
@PreDestroy
public void destroy() {
refreshExecutor.shutdown();
}
}

Loading…
Cancel
Save