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;