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
a91c8097
Commit
a91c8097
authored
May 18, 2016
by
lepdou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
56c36b72
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
PortalSettings.java
...src/main/java/com/ctrip/apollo/portal/PortalSettings.java
+9
-7
No files found.
apollo-portal/src/main/java/com/ctrip/apollo/portal/PortalSettings.java
View file @
a91c8097
...
...
@@ -128,15 +128,13 @@ public class PortalSettings {
}
}
else
{
//maybe meta server up but admin server down
handleEnvDown
(
env
);
hasUpdateStatus
=
true
;
hasUpdateStatus
=
handleEnvDown
(
env
);
}
}
catch
(
Exception
e
)
{
//maybe meta server down
logger
.
warn
(
"health check fail. [env:{}]"
,
env
,
e
.
getMessage
());
handleEnvDown
(
env
);
hasUpdateStatus
=
true
;
hasUpdateStatus
=
handleEnvDown
(
env
);
}
}
...
...
@@ -151,13 +149,17 @@ public class PortalSettings {
return
"UP"
.
equals
(
health
.
getStatus
().
getCode
());
}
private
void
handleEnvDown
(
Env
env
)
{
private
boolean
handleEnvDown
(
Env
env
)
{
long
failCnt
=
healthCheckFailCnt
.
get
(
env
);
healthCheckFailCnt
.
put
(
env
,
++
failCnt
);
if
(
failCnt
>=
ENV_DIED_THREADHOLD
)
{
if
(
envStatusMark
.
get
(
env
)
&&
failCnt
>=
ENV_DIED_THREADHOLD
)
{
envStatusMark
.
put
(
env
,
false
);
logger
.
error
(
"env down [env:{}]"
,
env
);
logger
.
error
(
"env turn to down [env:{}]"
,
env
);
return
true
;
}
else
{
logger
.
warn
(
"[env:{}] down yet."
,
env
);
return
false
;
}
}
...
...
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