From be89b70cf0e63f054ff4b02bc258b51f998fafab Mon Sep 17 00:00:00 2001 From: LaurenceLiZhixin <382673304@qq.com> Date: Sun, 17 Jan 2021 17:27:11 +0800 Subject: [PATCH] fix: chinglish --- cluster/cluster_impl/base_cluster_invoker.go | 2 +- common/extension/conn_checker.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cluster/cluster_impl/base_cluster_invoker.go b/cluster/cluster_impl/base_cluster_invoker.go index a2d65291f..e76b5bf6f 100644 --- a/cluster/cluster_impl/base_cluster_invoker.go +++ b/cluster/cluster_impl/base_cluster_invoker.go @@ -136,7 +136,7 @@ func (invoker *baseClusterInvoker) doSelectInvoker(lb cluster.LoadBalance, invoc selectedInvoker := lb.Select(invokers, invocation) - //judge to if the selectedInvoker is invoked and available + //judge if the selected Invoker is invoked and available if (!selectedInvoker.IsAvailable() && invoker.availablecheck) || isInvoked(selectedInvoker, invoked) { protocol.SetInvokerUnhealthyStatus(selectedInvoker) otherInvokers := getOtherInvokers(invokers, selectedInvoker) diff --git a/common/extension/conn_checker.go b/common/extension/conn_checker.go index 99add91f8..fbd9e34b2 100644 --- a/common/extension/conn_checker.go +++ b/common/extension/conn_checker.go @@ -33,7 +33,8 @@ func SetConnChecker(name string, fcn func(_ *common.URL) router.ConnChecker) { // GetHealthChecker gets the HealthChecker with @name func GetConnChecker(name string, url *common.URL) router.ConnChecker { - if connCheckers[name] == nil { + f, ok := connCheckers[name] + if !ok || f == nil { panic("connCheckers for " + name + " is not existing, make sure you have import the package.") } return connCheckers[name](url) -- GitLab