Fix the expiration logic
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 6 Feb 2011 20:17:58 +0000 (20:17 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 6 Feb 2011 20:17:58 +0000 (20:17 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1067743 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/valves/CrawlerSessionManagerValve.java

index e59240a..e4fc4b5 100644 (file)
@@ -155,7 +155,7 @@ public class CrawlerSessionManagerValve extends ValveBase {
     public void backgroundProcess() {
         super.backgroundProcess();
         
-        long expireTime = System.currentTimeMillis() +
+        long expireTime = System.currentTimeMillis() -
                 (sessionInactiveInterval + 60) * 1000;
 
         Iterator<Entry<String,SessionInfo>> iter =
@@ -164,7 +164,7 @@ public class CrawlerSessionManagerValve extends ValveBase {
         // Remove any sessions in the cache that have expired. 
         while (iter.hasNext()) {
             Entry<String,SessionInfo> entry = iter.next();
-            if (entry.getValue().getLastAccessed() > expireTime) {
+            if (entry.getValue().getLastAccessed() < expireTime) {
                 iter.remove();
             }
         }