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
57ddd524
Commit
57ddd524
authored
Jun 22, 2016
by
张乐
Committed by
GitHub
Jun 22, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #285 from nobodyiam/fix-client-rate-limiter-issue
use tryAcquire to avoid acquire compatibility issue
parents
b75a4114
98fea81f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
RemoteConfigRepository.java
...ip/framework/apollo/internals/RemoteConfigRepository.java
+2
-2
No files found.
apollo-client/src/main/java/com/ctrip/framework/apollo/internals/RemoteConfigRepository.java
View file @
57ddd524
...
...
@@ -161,7 +161,7 @@ public class RemoteConfigRepository extends AbstractConfigRepository {
}
private
ApolloConfig
loadApolloConfig
()
{
m_loadConfigRateLimiter
.
acquire
();
m_loadConfigRateLimiter
.
tryAcquire
(
5
,
TimeUnit
.
SECONDS
);
//wait at most 5 seconds
String
appId
=
m_configUtil
.
getAppId
();
String
cluster
=
m_configUtil
.
getCluster
();
String
dataCenter
=
m_configUtil
.
getDataCenter
();
...
...
@@ -285,7 +285,7 @@ public class RemoteConfigRepository extends AbstractConfigRepository {
final
Random
random
=
new
Random
();
ServiceDTO
lastServiceDto
=
null
;
while
(!
m_longPollingStopped
.
get
()
&&
!
Thread
.
currentThread
().
isInterrupted
())
{
m_longPollRateLimiter
.
acquire
();
m_longPollRateLimiter
.
tryAcquire
(
5
,
TimeUnit
.
SECONDS
);
//wait at most 5 seconds
Transaction
transaction
=
Cat
.
newTransaction
(
"Apollo.ConfigService"
,
"pollNotification"
);
try
{
if
(
lastServiceDto
==
null
)
{
...
...
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