Merge branch 'Tencent:main' into feature-extension-actuator

pull/343/head
qingliu 3 years ago committed by GitHub
commit f8dc5aa297
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -28,3 +28,6 @@
- [Feature: support actuator for sct core components](https://github.com/Tencent/spring-cloud-tencent/pull/343)
- [test:update junit of metadata.](https://github.com/Tencent/spring-cloud-tencent/pull/340)
- [Optimize code style & unit test case](https://github.com/Tencent/spring-cloud-tencent/pull/336)
- [rm code: Condition 'null != interceptors' is always 'true' ](https://github.com/Tencent/spring-cloud-tencent/pull/342)
- [fix: shutdown thread pool before the container closes](https://github.com/Tencent/spring-cloud-tencent/pull/353)
- [docs:update logo in README.](https://github.com/Tencent/spring-cloud-tencent/pull/358)

@ -1,4 +1,4 @@
<img src="https://user-images.githubusercontent.com/4991116/176166888-9c8a4074-ba42-41b8-93db-d6e95b16656b.png" width="60%" height="60%" alt="Spring-Cloud-Tencent-Logo"/>
<img src="https://github.com/Tencent/spring-cloud-tencent/raw/main/doc/logo/rectangle-white.png" width="60%" height="60%" alt="Spring-Cloud-Tencent-Logo"/>
[![Wiki](https://badgen.net/badge/icon/wiki?icon=wiki&label)](https://github.com/Tencent/spring-cloud-tencent/wiki)
[![Build Status](https://github.com/Tencent/spring-cloud-tencent/actions/workflows/junit_test.yml/badge.svg)](https://github.com/Tencent/spring-cloud-tencent/actions/workflows/junit_test.yml)

@ -1,4 +1,4 @@
<img src="https://user-images.githubusercontent.com/4991116/176166888-9c8a4074-ba42-41b8-93db-d6e95b16656b.png" width="60%" height="60%" alt="Spring-Cloud-Tencent-Logo"/>
<img src="https://github.com/Tencent/spring-cloud-tencent/raw/main/doc/logo/rectangle-white.png" width="60%" height="60%" alt="Spring-Cloud-Tencent-Logo"/>
[![Wiki](https://badgen.net/badge/icon/wiki?icon=wiki&label)](https://github.com/Tencent/spring-cloud-tencent/wiki)

@ -168,8 +168,7 @@ public class MetadataTransferAutoConfiguration {
List<ClientHttpRequestInterceptor> interceptors = restTemplate
.getInterceptors();
// Avoid setting interceptor repeatedly.
if (null != interceptors && !interceptors
.contains(encodeTransferMedataRestTemplateInterceptor)) {
if (!interceptors.contains(encodeTransferMedataRestTemplateInterceptor)) {
interceptors.add(encodeTransferMedataRestTemplateInterceptor);
restTemplate.setInterceptors(interceptors);
}
@ -207,10 +206,8 @@ public class MetadataTransferAutoConfiguration {
List<ClientHttpRequestInterceptor> interceptors = restTemplate
.getInterceptors();
// Avoid setting interceptor repeatedly.
if (null != interceptors && !interceptors
.contains(encodeTransferMedataRestTemplateInterceptor)) {
interceptors
.add(this.encodeTransferMedataRestTemplateInterceptor);
if (!interceptors.contains(encodeTransferMedataRestTemplateInterceptor)) {
interceptors.add(this.encodeTransferMedataRestTemplateInterceptor);
restTemplate.setInterceptors(interceptors);
}
}

@ -25,6 +25,7 @@ import com.tencent.polaris.client.util.NamedThreadFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.boot.context.event.ApplicationReadyEvent;
import org.springframework.cloud.client.discovery.event.HeartbeatEvent;
import org.springframework.context.ApplicationEventPublisher;
@ -38,7 +39,7 @@ import static com.tencent.cloud.polaris.discovery.refresh.PolarisServiceStatusCh
*
* @author Haotian Zhang
*/
public class PolarisRefreshApplicationReadyEventListener implements ApplicationListener<ApplicationReadyEvent>, ApplicationEventPublisherAware {
public class PolarisRefreshApplicationReadyEventListener implements ApplicationListener<ApplicationReadyEvent>, ApplicationEventPublisherAware, DisposableBean {
private static final Logger LOG = LoggerFactory.getLogger(PolarisRefreshApplicationReadyEventListener.class);
private static final int DELAY = 60;
@ -83,4 +84,9 @@ public class PolarisRefreshApplicationReadyEventListener implements ApplicationL
public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
this.publisher = applicationEventPublisher;
}
@Override
public void destroy() throws Exception {
refreshExecutor.shutdown();
}
}

Loading…
Cancel
Save