Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
discovery
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈文顺
discovery
Commits
c56e11f1
Commit
c56e11f1
authored
Sep 17, 2018
by
Nepxion
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复本地和远程规则文件全部缺失的情况下,抛空指针异常
parent
d0a755b4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
discovery-plugin-framework/src/main/java/com/nepxion/discovery/plugin/framework/decorator/PredicateBasedRuleDecorator.java
+4
-0
discovery-plugin-framework/src/main/java/com/nepxion/discovery/plugin/framework/decorator/ZoneAvoidanceRuleDecorator.java
+4
-0
No files found.
discovery-plugin-framework/src/main/java/com/nepxion/discovery/plugin/framework/decorator/PredicateBasedRuleDecorator.java
View file @
c56e11f1
...
...
@@ -36,6 +36,10 @@ public abstract class PredicateBasedRuleDecorator extends PredicateBasedRule {
@Override
public
Server
choose
(
Object
key
)
{
WeightFilterEntity
weightFilterEntity
=
weightRandomLoadBalance
.
getWeightFilterEntity
();
if
(
weightFilterEntity
==
null
)
{
return
super
.
choose
(
key
);
}
if
(!
weightFilterEntity
.
hasWeight
())
{
return
super
.
choose
(
key
);
}
...
...
discovery-plugin-framework/src/main/java/com/nepxion/discovery/plugin/framework/decorator/ZoneAvoidanceRuleDecorator.java
View file @
c56e11f1
...
...
@@ -36,6 +36,10 @@ public class ZoneAvoidanceRuleDecorator extends ZoneAvoidanceRule {
@Override
public
Server
choose
(
Object
key
)
{
WeightFilterEntity
weightFilterEntity
=
weightRandomLoadBalance
.
getWeightFilterEntity
();
if
(
weightFilterEntity
==
null
)
{
return
super
.
choose
(
key
);
}
if
(!
weightFilterEntity
.
hasWeight
())
{
return
super
.
choose
(
key
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment