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
bbdf8e55
Commit
bbdf8e55
authored
Mar 17, 2018
by
nobodyiam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1. adjust server side's long polling timeout from 30 seconds to 60 seconds
2. adjust client side's long polling timeout from 600 seconds to 90 seconds
parent
92ee12c6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
+4
-3
RemoteConfigLongPollService.java
...amework/apollo/internals/RemoteConfigLongPollService.java
+3
-2
DeferredResultWrapper.java
...k/apollo/configservice/wrapper/DeferredResultWrapper.java
+1
-1
No files found.
apollo-client/src/main/java/com/ctrip/framework/apollo/internals/RemoteConfigLongPollService.java
View file @
bbdf8e55
...
@@ -54,6 +54,8 @@ public class RemoteConfigLongPollService {
...
@@ -54,6 +54,8 @@ public class RemoteConfigLongPollService {
private
static
final
Joiner
.
MapJoiner
MAP_JOINER
=
Joiner
.
on
(
"&"
).
withKeyValueSeparator
(
"="
);
private
static
final
Joiner
.
MapJoiner
MAP_JOINER
=
Joiner
.
on
(
"&"
).
withKeyValueSeparator
(
"="
);
private
static
final
Escaper
queryParamEscaper
=
UrlEscapers
.
urlFormParameterEscaper
();
private
static
final
Escaper
queryParamEscaper
=
UrlEscapers
.
urlFormParameterEscaper
();
private
static
final
long
INIT_NOTIFICATION_ID
=
ConfigConsts
.
NOTIFICATION_ID_PLACEHOLDER
;
private
static
final
long
INIT_NOTIFICATION_ID
=
ConfigConsts
.
NOTIFICATION_ID_PLACEHOLDER
;
//90 seconds, should be longer than server side's long polling timeout, which is now 60 seconds
private
static
final
int
LONG_POLLING_READ_TIMEOUT
=
90
*
1000
;
private
final
ExecutorService
m_longPollingService
;
private
final
ExecutorService
m_longPollingService
;
private
final
AtomicBoolean
m_longPollingStopped
;
private
final
AtomicBoolean
m_longPollingStopped
;
private
SchedulePolicy
m_longPollFailSchedulePolicyInSecond
;
private
SchedulePolicy
m_longPollFailSchedulePolicyInSecond
;
...
@@ -161,8 +163,7 @@ public class RemoteConfigLongPollService {
...
@@ -161,8 +163,7 @@ public class RemoteConfigLongPollService {
logger
.
debug
(
"Long polling from {}"
,
url
);
logger
.
debug
(
"Long polling from {}"
,
url
);
HttpRequest
request
=
new
HttpRequest
(
url
);
HttpRequest
request
=
new
HttpRequest
(
url
);
//longer timeout for read - 10 minutes
request
.
setReadTimeout
(
LONG_POLLING_READ_TIMEOUT
);
request
.
setReadTimeout
(
600000
);
transaction
.
addData
(
"Url"
,
url
);
transaction
.
addData
(
"Url"
,
url
);
...
...
apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/wrapper/DeferredResultWrapper.java
View file @
bbdf8e55
...
@@ -17,7 +17,7 @@ import java.util.Map;
...
@@ -17,7 +17,7 @@ import java.util.Map;
* @author Jason Song(song_s@ctrip.com)
* @author Jason Song(song_s@ctrip.com)
*/
*/
public
class
DeferredResultWrapper
{
public
class
DeferredResultWrapper
{
private
static
final
long
TIMEOUT
=
30
*
1000
;
//3
0 seconds
private
static
final
long
TIMEOUT
=
60
*
1000
;
//6
0 seconds
private
static
final
ResponseEntity
<
List
<
ApolloConfigNotification
>>
private
static
final
ResponseEntity
<
List
<
ApolloConfigNotification
>>
NOT_MODIFIED_RESPONSE_LIST
=
new
ResponseEntity
<>(
HttpStatus
.
NOT_MODIFIED
);
NOT_MODIFIED_RESPONSE_LIST
=
new
ResponseEntity
<>(
HttpStatus
.
NOT_MODIFIED
);
...
...
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