diff --git a/shenyu-admin/src/main/java/org/apache/shenyu/admin/listener/http/HttpLongPollingDataChangedListener.java b/shenyu-admin/src/main/java/org/apache/shenyu/admin/listener/http/HttpLongPollingDataChangedListener.java index 962189613c3f..280cf901c472 100644 --- a/shenyu-admin/src/main/java/org/apache/shenyu/admin/listener/http/HttpLongPollingDataChangedListener.java +++ b/shenyu-admin/src/main/java/org/apache/shenyu/admin/listener/http/HttpLongPollingDataChangedListener.java @@ -359,11 +359,11 @@ class LongPollingClient implements Runnable { @Override public void run() { try { - this.asyncTimeoutFuture = scheduler.scheduleWithFixedDelay(() -> { + this.asyncTimeoutFuture = scheduler.schedule(() -> { clients.remove(LongPollingClient.this); List changedGroups = compareChangedGroup((HttpServletRequest) asyncContext.getRequest()); sendResponse(changedGroups); - }, 0, timeoutTime, TimeUnit.MILLISECONDS); + }, timeoutTime, TimeUnit.MILLISECONDS); clients.add(this); } catch (Exception ex) { log.error("add long polling client error", ex); diff --git a/shenyu-common/src/main/java/org/apache/shenyu/common/constant/HttpConstants.java b/shenyu-common/src/main/java/org/apache/shenyu/common/constant/HttpConstants.java index ec61a8808541..7d29fd88c1c7 100644 --- a/shenyu-common/src/main/java/org/apache/shenyu/common/constant/HttpConstants.java +++ b/shenyu-common/src/main/java/org/apache/shenyu/common/constant/HttpConstants.java @@ -34,7 +34,7 @@ public final class HttpConstants { /** * The maximum timeout of server block is 60s. */ - public static final long SERVER_MAX_HOLD_TIMEOUT = TimeUnit.SECONDS.toMillis(30); + public static final long SERVER_MAX_HOLD_TIMEOUT = TimeUnit.SECONDS.toMillis(60); /** * Default connection timeout is 10s.