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

Merge pull request #1207 from xht555/bugfix

shutdown the taskScheduler when the NacosWatch bean is destroyed.
This commit is contained in:
Jim Fang 2020-02-19 00:39:52 +08:00 committed by GitHub
commit 05d56536c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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