Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
apollo
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
apollo
Commits
ea601575
Unverified
Commit
ea601575
authored
Apr 21, 2019
by
Jason Song
Committed by
GitHub
Apr 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix the performance issue when calling getHostName (#2152)
parent
11640388
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
apollo-core/src/main/java/com/ctrip/framework/foundation/internals/NetworkInterfaceManager.java
...amework/foundation/internals/NetworkInterfaceManager.java
+6
-1
No files found.
apollo-core/src/main/java/com/ctrip/framework/foundation/internals/NetworkInterfaceManager.java
View file @
ea601575
...
@@ -42,11 +42,16 @@ public enum NetworkInterfaceManager {
...
@@ -42,11 +42,16 @@ public enum NetworkInterfaceManager {
weight
+=
2
;
weight
+=
2
;
}
}
/**
* The following logic is removed as we will sort the network interfaces according to the index asc to determine
* the priorities between network interfaces, see https://github.com/ctripcorp/apollo/pull/1986
*/
// has host name
// has host name
/
/ TODO fix performance issue when calling getHostName
/
*
if (!Objects.equals(address.getHostName(), address.getHostAddress())) {
if (!Objects.equals(address.getHostName(), address.getHostAddress())) {
weight += 1;
weight += 1;
}
}
*/
if
(
weight
>
maxWeight
)
{
if
(
weight
>
maxWeight
)
{
maxWeight
=
weight
;
maxWeight
=
weight
;
...
...
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