diff --git a/config/config_loader.go b/config/config_loader.go index 6f97f6dc7abf27e398974dc83e374ef749ec9f97..14dcacad54770916ce0aba2b0fa123bd21f24a2d 100644 --- a/config/config_loader.go +++ b/config/config_loader.go @@ -255,18 +255,23 @@ func Load() (map[string]*ReferenceConfig, map[string]*ServiceConfig) { checkok := true for { for _, refconfig := range consumerConfig.References { - if ((refconfig.Check != nil && *refconfig.Check) || + if (refconfig.Check != nil && *refconfig.Check) || (refconfig.Check == nil && consumerConfig.Check != nil && *consumerConfig.Check) || - (refconfig.Check == nil && consumerConfig.Check == nil)) && //default to true - refconfig.invoker != nil && - !refconfig.invoker.IsAvailable() { - checkok = false - count++ - if count > maxWait { - panic(fmt.Sprintf("Failed to check the status of the service %v . No provider available for the service to the consumer use dubbo version %v", refconfig.InterfaceName, version.Version)) + (refconfig.Check == nil && consumerConfig.Check == nil) { //default to true + + if refconfig.invoker != nil && + !refconfig.invoker.IsAvailable() { + checkok = false + count++ + if count > maxWait { + panic(fmt.Sprintf("Failed to check the status of the service %v . No provider available for the service to the consumer use dubbo version %v", refconfig.InterfaceName, version.Version)) + } + time.Sleep(time.Second * 1) + break + } + if refconfig.invoker == nil { + log.Warn("The interface %s invoker not exsist , may you should check your interface config.", refconfig.InterfaceName) } - time.Sleep(time.Second * 1) - break } } if checkok {