Merge pull request #1002 from alibaba/hotfix_remove_service_failed

#961 init cluster after instantiate cluster
This commit is contained in:
Fury Zhu 2019-04-04 10:40:35 +08:00 committed by GitHub
commit 53d154d6c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

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

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);
}