未验证 提交 ef212cca 编写于 作者: Z zhuyou1234 提交者: GitHub

代码优化 (#9752)

调整timeout位置
上级 7e24ab9f
......@@ -246,11 +246,12 @@ public class LongPollingService {
int delayTime = SwitchService.getSwitchInteger(SwitchService.FIXED_DELAY_TIME, 500);
// Add delay time for LoadBalance, and one response is returned 500 ms in advance to avoid client timeout.
long timeout = Math.max(10000, Long.parseLong(str) - delayTime);
long timeout = -1L;
if (isFixedPolling()) {
timeout = Math.max(10000, getFixedPollingInterval());
// Do nothing but set fix polling timeout.
} else {
timeout = Math.max(10000, Long.parseLong(str) - delayTime);
long start = System.currentTimeMillis();
List<String> changedGroups = MD5Util.compareMd5(req, rsp, clientMd5Map);
if (changedGroups.size() > 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册