Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
apollo
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
openSource
apollo
Commits
3aae94de
Commit
3aae94de
authored
Dec 07, 2016
by
lepdou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
portal use ApolloThreadFactory to create thread
parent
e75ad88f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
AdminServiceAddressLocator.java
.../apollo/portal/components/AdminServiceAddressLocator.java
+5
-2
PortalSettings.java
...ip/framework/apollo/portal/components/PortalSettings.java
+4
-1
No files found.
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/components/AdminServiceAddressLocator.java
View file @
3aae94de
...
...
@@ -5,6 +5,7 @@ import com.google.common.collect.Lists;
import
com.ctrip.framework.apollo.core.MetaDomainConsts
;
import
com.ctrip.framework.apollo.core.dto.ServiceDTO
;
import
com.ctrip.framework.apollo.core.enums.Env
;
import
com.ctrip.framework.apollo.core.utils.ApolloThreadFactory
;
import
com.ctrip.framework.apollo.tracer.Tracer
;
import
org.slf4j.Logger
;
...
...
@@ -66,7 +67,8 @@ public class AdminServiceAddressLocator {
rf
.
setConnectTimeout
(
DEFAULT_TIMEOUT_MS
);
}
refreshServiceAddressService
=
Executors
.
newScheduledThreadPool
(
1
);
refreshServiceAddressService
=
Executors
.
newScheduledThreadPool
(
1
,
ApolloThreadFactory
.
create
(
"ServiceLocator"
,
false
));
refreshServiceAddressService
.
schedule
(
new
RefreshAdminServerAddressTask
(),
1
,
TimeUnit
.
MILLISECONDS
);
}
...
...
@@ -117,7 +119,8 @@ public class AdminServiceAddressLocator {
}
catch
(
Throwable
e
)
{
logger
.
error
(
String
.
format
(
"Get admin server address from meta server failed. env: %s, meta server address:%s"
,
env
,
MetaDomainConsts
.
getDomain
(
env
)),
e
);
Tracer
.
logError
(
String
.
format
(
"Get admin server address from meta server failed. env: %s, meta server address:%s"
,
Tracer
.
logError
(
String
.
format
(
"Get admin server address from meta server failed. env: %s, meta server address:%s"
,
env
,
MetaDomainConsts
.
getDomain
(
env
)),
e
);
}
}
...
...
apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/components/PortalSettings.java
View file @
3aae94de
...
...
@@ -2,6 +2,7 @@ package com.ctrip.framework.apollo.portal.components;
import
com.ctrip.framework.apollo.core.enums.Env
;
import
com.ctrip.framework.apollo.core.utils.ApolloThreadFactory
;
import
com.ctrip.framework.apollo.portal.api.AdminServiceAPI
;
import
com.ctrip.framework.apollo.portal.service.ServerConfigService
;
...
...
@@ -58,7 +59,9 @@ public class PortalSettings {
envStatusMark
.
put
(
env
,
true
);
}
ScheduledExecutorService
healthCheckService
=
Executors
.
newScheduledThreadPool
(
1
);
ScheduledExecutorService
healthCheckService
=
Executors
.
newScheduledThreadPool
(
1
,
ApolloThreadFactory
.
create
(
"EnvHealthChecker"
,
false
));
healthCheckService
.
scheduleWithFixedDelay
(
new
HealthCheckTask
(
applicationContext
),
1000
,
HEALTH_CHECK_INTERVAL
,
...
...
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