提交 d0d8945f 编写于 作者: J Jason Song

Merge pull request #234 from nobodyiam/long-poll-timeout

shorten long polling timeout
...@@ -274,8 +274,8 @@ public class RemoteConfigRepository extends AbstractConfigRepository { ...@@ -274,8 +274,8 @@ public class RemoteConfigRepository extends AbstractConfigRepository {
logger.debug("Long polling from {}", url); logger.debug("Long polling from {}", url);
HttpRequest request = new HttpRequest(url); HttpRequest request = new HttpRequest(url);
//no timeout for read //longer timeout for read - 1 minute
request.setReadTimeout(0); request.setReadTimeout(60000);
transaction = Cat.newTransaction("Apollo.ConfigService", "pollNotification"); transaction = Cat.newTransaction("Apollo.ConfigService", "pollNotification");
transaction.addData("Url", url); transaction.addData("Url", url);
......
...@@ -40,7 +40,7 @@ import java.util.Set; ...@@ -40,7 +40,7 @@ import java.util.Set;
@RequestMapping("/notifications") @RequestMapping("/notifications")
public class NotificationController implements MessageListener { public class NotificationController implements MessageListener {
private static final Logger logger = LoggerFactory.getLogger(NotificationController.class); private static final Logger logger = LoggerFactory.getLogger(NotificationController.class);
private static final long TIMEOUT = 360 * 60 * 1000;//6 hours private static final long TIMEOUT = 30 * 1000;//30 seconds
private final Multimap<String, DeferredResult<ResponseEntity<ApolloConfigNotification>>> private final Multimap<String, DeferredResult<ResponseEntity<ApolloConfigNotification>>>
deferredResults = Multimaps.synchronizedSetMultimap(HashMultimap.create()); deferredResults = Multimaps.synchronizedSetMultimap(HashMultimap.create());
private static final ResponseEntity<ApolloConfigNotification> private static final ResponseEntity<ApolloConfigNotification>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册