Skip to content

Commit

Permalink
Merge pull request alibaba#2254 from Pengfei-Lu/alibabagh-2253-fix
Browse files Browse the repository at this point in the history
Fixes alibaba#2253: ThreadPoolTaskScheduler instance in NacosWatch can't be shutdown.
  • Loading branch information
yuhuangbin authored Sep 27, 2021
2 parents 387dd46 + 03e1675 commit 989cf42
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.cloud.client.discovery.event.HeartbeatEvent;
import org.springframework.context.ApplicationEventPublisher;
Expand All @@ -45,8 +46,9 @@
/**
* @author xiaojing
* @author yuhuangbin
* @author pengfei.lu
*/
public class NacosWatch implements ApplicationEventPublisherAware, SmartLifecycle {
public class NacosWatch implements ApplicationEventPublisherAware, SmartLifecycle, DisposableBean {

private static final Logger log = LoggerFactory.getLogger(NacosWatch.class);

Expand Down Expand Up @@ -199,4 +201,8 @@ public void nacosServicesWatch() {

}

@Override
public void destroy() {
this.stop();
}
}

0 comments on commit 989cf42

Please sign in to comment.