Skip to content

Commit

Permalink
:firehorse: Fixes #1903
Browse files Browse the repository at this point in the history
  • Loading branch information
jfarcand committed Mar 17, 2015
1 parent c3cfa5c commit 91a9ee9
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.atmosphere.cpr.AtmosphereResource;
import org.atmosphere.cpr.AtmosphereResourceImpl;
import org.atmosphere.util.ExecutorsFactory;
import org.atmosphere.util.Utils;
import org.atmosphere.websocket.WebSocket;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -78,6 +79,11 @@ protected void idleResources() {
}

for (AtmosphereResource r : config.resourcesFactory().findAll()) {

if (Utils.pollableTransport(r.transport())) {
continue;
}

AtmosphereRequest req = AtmosphereResourceImpl.class.cast(r).getRequest(false);
try {
if (req.getAttribute(MAX_INACTIVE) == null) {
Expand Down Expand Up @@ -131,7 +137,7 @@ public IdleResourceInterceptor maxInactiveTime(long maxInactiveTime) {

@Override
public Action inspect(AtmosphereResource r) {
if (maxInactiveTime > 0) {
if (maxInactiveTime > 0 && !Utils.pollableTransport(r.transport())) {
AtmosphereResourceImpl.class.cast(r).getRequest(false).setAttribute(MAX_INACTIVE, System.currentTimeMillis());
}
return Action.CONTINUE;
Expand Down

0 comments on commit 91a9ee9

Please sign in to comment.