Skip to content

Commit

Permalink
add judge about the existence of instance's metadata revision
Browse files Browse the repository at this point in the history
  • Loading branch information
Leospard committed Jan 5, 2023
1 parent ebec1c3 commit b0a3801
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion registry/servicediscovery/service_discovery_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,11 @@ func (s *serviceDiscoveryRegistry) LoadSubscribeInstances(url *common.URL, notif
logger.Warnf("Instance metadata is nil: %s", instance.GetHost())
continue
}
revision := instance.GetMetadata()[constant.ExportedServicesRevisionPropertyName]
revision, ok := instance.GetMetadata()[constant.ExportedServicesRevisionPropertyName]
if !ok {
logger.Warnf("Instance metadata revision is nil: %s", instance.GetHost())
continue
}
if "0" == revision {
logger.Infof("Find instance without valid service metadata: %s", instance.GetHost())
continue
Expand Down

0 comments on commit b0a3801

Please sign in to comment.