Skip to content

Commit

Permalink
fix: use configured push parameter (#12700) (#12706)
Browse files Browse the repository at this point in the history
Get the push suspend timout
parameter from the configuration
as atmosphere doesn't read it
from anywhere.

Fixes #12559

Co-authored-by: caalador <[email protected]>
  • Loading branch information
vaadin-bot and caalador authored Jan 12, 2022
1 parent 04a1ca6 commit dcc7910
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit dcc7910

Please sign in to comment.