Skip to content

Commit

Permalink
refine comments
Browse files Browse the repository at this point in the history
  • Loading branch information
louyuting committed Nov 16, 2020
1 parent b2654ad commit e90dc22
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/hotspot/rule_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func LoadRules(rules []*Rule) (bool, error) {
isEqual := reflect.DeepEqual(currentRules, rules)
tcMux.RUnlock()
if isEqual {
logging.Info("[HotSpot] Load rules repetition, does not load")
logging.Info("[HotSpot] Load rules is the same with current rules, so ignore load operation.")
return false, nil
}

Expand Down
4 changes: 2 additions & 2 deletions core/isolation/rule_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (

"github.com/alibaba/sentinel-golang/core/misc"
"github.com/alibaba/sentinel-golang/util"

"github.com/alibaba/sentinel-golang/logging"
"github.com/pkg/errors"
)
Expand All @@ -18,12 +17,13 @@ var (
)

// LoadRules loads the given isolation rules to the rule manager, while all previous rules will be replaced.
// the first returned value indicates whether do real load operation, if the rules is the same with previous rules, return false
func LoadRules(rules []*Rule) (bool, error) {
rwMux.RLock()
isEqual := reflect.DeepEqual(currentRules, rules)
rwMux.RUnlock()
if isEqual {
logging.Info("[Isolation] Load rules repetition, does not load")
logging.Info("[Isolation] Load rules is the same with current rules, so ignore load operation.")
return false, nil
}

Expand Down

0 comments on commit e90dc22

Please sign in to comment.