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
c8f84a63
Unverified
Commit
c8f84a63
authored
Feb 06, 2019
by
Jason Song
Committed by
GitHub
Feb 06, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1949 from nobodyiam/fix-1885
add rate limter for no app id warning log
parents
ecfb400d
005f4454
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
apollo-client/src/main/java/com/ctrip/framework/apollo/util/ConfigUtil.java
...main/java/com/ctrip/framework/apollo/util/ConfigUtil.java
+7
-2
No files found.
apollo-client/src/main/java/com/ctrip/framework/apollo/util/ConfigUtil.java
View file @
c8f84a63
package
com
.
ctrip
.
framework
.
apollo
.
util
;
import
com.google.common.util.concurrent.RateLimiter
;
import
java.io.File
;
import
java.util.concurrent.TimeUnit
;
...
...
@@ -34,8 +35,10 @@ public class ConfigUtil {
private
TimeUnit
configCacheExpireTimeUnit
=
TimeUnit
.
MINUTES
;
//1 minute
private
long
longPollingInitialDelayInMills
=
2000
;
//2 seconds
private
boolean
autoUpdateInjectedSpringProperties
=
true
;
private
final
RateLimiter
warnLogRateLimiter
;
public
ConfigUtil
()
{
warnLogRateLimiter
=
RateLimiter
.
create
(
0.017
);
// 1 warning log output per minute
initRefreshInterval
();
initConnectTimeout
();
initReadTimeout
();
...
...
@@ -55,8 +58,10 @@ public class ConfigUtil {
String
appId
=
Foundation
.
app
().
getAppId
();
if
(
Strings
.
isNullOrEmpty
(
appId
))
{
appId
=
ConfigConsts
.
NO_APPID_PLACEHOLDER
;
logger
.
warn
(
"app.id is not set, please make sure it is set in classpath:/META-INF/app.properties, now apollo "
+
"will only load public namespace configurations!"
);
if
(
warnLogRateLimiter
.
tryAcquire
())
{
logger
.
warn
(
"app.id is not set, please make sure it is set in classpath:/META-INF/app.properties, now apollo will only load public namespace configurations!"
);
}
}
return
appId
;
}
...
...
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