Skip to content

Commit

Permalink
Fix register failed if re-register service discovery (#12795)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbumenJ authored Jul 26, 2023
1 parent 5caa852 commit 9837cfb
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,13 @@ public synchronized void register() throws RuntimeException {
if (isDestroy) {
return;
}
ServiceInstance serviceInstance = createServiceInstance(this.metadataInfo);
if (!isValidInstance(serviceInstance)) {
return;
if (this.serviceInstance == null) {
ServiceInstance serviceInstance = createServiceInstance(this.metadataInfo);
if (!isValidInstance(serviceInstance)) {
return;
}
this.serviceInstance = serviceInstance;
}
this.serviceInstance = serviceInstance;
boolean revisionUpdated = calOrUpdateInstanceRevision(this.serviceInstance);
if (revisionUpdated) {
reportMetadata(this.metadataInfo);
Expand Down

0 comments on commit 9837cfb

Please sign in to comment.