Commit d0d8945f by Jason Song

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

shorten long polling timeout
parents a385ec80 fe3782b5
......@@ -274,8 +274,8 @@ public class RemoteConfigRepository extends AbstractConfigRepository {
logger.debug("Long polling from {}", url);
HttpRequest request = new HttpRequest(url);
//no timeout for read
request.setReadTimeout(0);
//longer timeout for read - 1 minute
request.setReadTimeout(60000);
transaction = Cat.newTransaction("Apollo.ConfigService", "pollNotification");
transaction.addData("Url", url);
......
......@@ -40,7 +40,7 @@ import java.util.Set;
@RequestMapping("/notifications")
public class NotificationController implements MessageListener {
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>>>
deferredResults = Multimaps.synchronizedSetMultimap(HashMultimap.create());
private static final ResponseEntity<ApolloConfigNotification>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment