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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
4 deletions
+10
-4
AdminServiceAddressLocator.java
.../apollo/portal/components/AdminServiceAddressLocator.java
+6
-3
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;
...
@@ -5,6 +5,7 @@ import com.google.common.collect.Lists;
import
com.ctrip.framework.apollo.core.MetaDomainConsts
;
import
com.ctrip.framework.apollo.core.MetaDomainConsts
;
import
com.ctrip.framework.apollo.core.dto.ServiceDTO
;
import
com.ctrip.framework.apollo.core.dto.ServiceDTO
;
import
com.ctrip.framework.apollo.core.enums.Env
;
import
com.ctrip.framework.apollo.core.enums.Env
;
import
com.ctrip.framework.apollo.core.utils.ApolloThreadFactory
;
import
com.ctrip.framework.apollo.tracer.Tracer
;
import
com.ctrip.framework.apollo.tracer.Tracer
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -66,7 +67,8 @@ public class AdminServiceAddressLocator {
...
@@ -66,7 +67,8 @@ public class AdminServiceAddressLocator {
rf
.
setConnectTimeout
(
DEFAULT_TIMEOUT_MS
);
rf
.
setConnectTimeout
(
DEFAULT_TIMEOUT_MS
);
}
}
refreshServiceAddressService
=
Executors
.
newScheduledThreadPool
(
1
);
refreshServiceAddressService
=
Executors
.
newScheduledThreadPool
(
1
,
ApolloThreadFactory
.
create
(
"ServiceLocator"
,
false
));
refreshServiceAddressService
.
schedule
(
new
RefreshAdminServerAddressTask
(),
1
,
TimeUnit
.
MILLISECONDS
);
refreshServiceAddressService
.
schedule
(
new
RefreshAdminServerAddressTask
(),
1
,
TimeUnit
.
MILLISECONDS
);
}
}
...
@@ -117,8 +119,9 @@ public class AdminServiceAddressLocator {
...
@@ -117,8 +119,9 @@ public class AdminServiceAddressLocator {
}
catch
(
Throwable
e
)
{
}
catch
(
Throwable
e
)
{
logger
.
error
(
String
.
format
(
"Get admin server address from meta server failed. env: %s, meta server address:%s"
,
logger
.
error
(
String
.
format
(
"Get admin server address from meta server failed. env: %s, meta server address:%s"
,
env
,
MetaDomainConsts
.
getDomain
(
env
)),
e
);
env
,
MetaDomainConsts
.
getDomain
(
env
)),
e
);
Tracer
.
logError
(
String
.
format
(
"Get admin server address from meta server failed. env: %s, meta server address:%s"
,
Tracer
env
,
MetaDomainConsts
.
getDomain
(
env
)),
e
);
.
logError
(
String
.
format
(
"Get admin server address from meta server failed. env: %s, meta server address:%s"
,
env
,
MetaDomainConsts
.
getDomain
(
env
)),
e
);
}
}
}
}
return
false
;
return
false
;
...
...
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;
...
@@ -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.enums.Env
;
import
com.ctrip.framework.apollo.core.utils.ApolloThreadFactory
;
import
com.ctrip.framework.apollo.portal.api.AdminServiceAPI
;
import
com.ctrip.framework.apollo.portal.api.AdminServiceAPI
;
import
com.ctrip.framework.apollo.portal.service.ServerConfigService
;
import
com.ctrip.framework.apollo.portal.service.ServerConfigService
;
...
@@ -58,7 +59,9 @@ public class PortalSettings {
...
@@ -58,7 +59,9 @@ public class PortalSettings {
envStatusMark
.
put
(
env
,
true
);
envStatusMark
.
put
(
env
,
true
);
}
}
ScheduledExecutorService
healthCheckService
=
Executors
.
newScheduledThreadPool
(
1
);
ScheduledExecutorService
healthCheckService
=
Executors
.
newScheduledThreadPool
(
1
,
ApolloThreadFactory
.
create
(
"EnvHealthChecker"
,
false
));
healthCheckService
healthCheckService
.
scheduleWithFixedDelay
(
new
HealthCheckTask
(
applicationContext
),
1000
,
HEALTH_CHECK_INTERVAL
,
.
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