1
0
mirror of https://gitee.com/mirrors/Spring-Cloud-Alibaba.git synced 2021-06-26 13:25:11 +08:00

shutdown the taskScheduler when the NacosWatch bean is destroyed.

This commit is contained in:
xht555 2020-02-18 22:28:26 +08:00
parent 88b8319eda
commit 0d73a30e39

View File

@ -106,13 +106,17 @@ public class NacosWatch implements ApplicationEventPublisherAware, SmartLifecycl
@Override
public void stop() {
if (this.running.compareAndSet(true, false) && this.watchFuture != null) {
// shutdown current user-thread,
// then the other daemon-threads will terminate automatic.
((ThreadPoolTaskScheduler)this.taskScheduler).shutdown();
this.watchFuture.cancel(true);
}
}
@Override
public boolean isRunning() {
return false;
return this.running.get();
}
@Override