#961 init cluster after instantiate cluster

This commit is contained in:
nkorange 2019-04-03 17:07:18 +08:00
parent 539280c44b
commit 35edfd4383
2 changed files with 4 additions and 1 deletions

View File

@ -99,7 +99,9 @@ public class Cluster extends com.alibaba.nacos.api.naming.pojo.Cluster implement
}
public void destroy() {
checkTask.setCancelled(true);
if (checkTask != null) {
checkTask.setCancelled(true);
}
}
public HealthCheckTask getHealthCheckTask() {

View File

@ -217,6 +217,7 @@ public class Service extends com.alibaba.nacos.api.naming.pojo.Service implement
instance.getClusterName(), instance.toJSON());
Cluster cluster = new Cluster(instance.getClusterName());
cluster.setService(this);
cluster.init();
getClusterMap().put(instance.getClusterName(), cluster);
}