From 7c5bcaa461ed10896d1423de0502e7f144dbfa6f Mon Sep 17 00:00:00 2001 From: caalador Date: Wed, 12 Jan 2022 14:08:13 +0200 Subject: [PATCH] fix: use configured push parameter (#12700) Get the push suspend timout parameter from the configuration as atmosphere doesn't read it from anywhere. Fixes #12559 --- .../flow/server/communication/PushRequestHandler.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/flow-server/src/main/java/com/vaadin/flow/server/communication/PushRequestHandler.java b/flow-server/src/main/java/com/vaadin/flow/server/communication/PushRequestHandler.java index bc1f6620403..307c7c9a258 100644 --- a/flow-server/src/main/java/com/vaadin/flow/server/communication/PushRequestHandler.java +++ b/flow-server/src/main/java/com/vaadin/flow/server/communication/PushRequestHandler.java @@ -102,10 +102,13 @@ public PushRequestHandler(VaadinServletService service) getLogger().debug("Using pre-initialized Atmosphere for servlet {}", vaadinServletConfig.getServletName()); } - pushHandler.setLongPollingSuspendTimeout( - atmosphere.getAtmosphereConfig().getInitParameter( - InitParameters.SERVLET_PARAMETER_PUSH_SUSPEND_TIMEOUT_LONGPOLLING, - -1)); + String timeout = service.getDeploymentConfiguration().getStringProperty( + InitParameters.SERVLET_PARAMETER_PUSH_SUSPEND_TIMEOUT_LONGPOLLING, + "-1"); + atmosphere.addInitParameter( + InitParameters.SERVLET_PARAMETER_PUSH_SUSPEND_TIMEOUT_LONGPOLLING, + timeout); + pushHandler.setLongPollingSuspendTimeout(Integer.parseInt(timeout)); for (AtmosphereHandlerWrapper handlerWrapper : atmosphere .getAtmosphereHandlers().values()) { AtmosphereHandler handler = handlerWrapper.atmosphereHandler;