]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
GC sessions one by one to make sure memcached gets cleared
authorEvan Prodromou <evan@controlyourself.ca>
Sun, 2 Aug 2009 14:34:23 +0000 (10:34 -0400)
committerEvan Prodromou <evan@controlyourself.ca>
Sun, 2 Aug 2009 14:34:23 +0000 (10:34 -0400)
classes/Session.php

index ac80279c5e300aab9429ffb4e367a00910d434f2..a92ce405b518f34dbe03c93a90c6591d4d2e9eb7 100644 (file)
@@ -110,9 +110,18 @@ class Session extends Memcached_DataObject
 
         $session = new Session();
         $session->whereAdd('modified < "'.$epoch.'"');
-        $result = $session->delete(DB_DATAOBJECT_WHEREADD_ONLY);
 
-        self::logdeb("garbage collection result = $result");
+        $session->find();
+
+        while ($session->fetch()) {
+            $other = new Session();
+            $other->id = $session->id;
+            self::logdeb("Collecting session $other->id");
+            $result = $other->delete();
+            self::logdeb("garbage collection result = $result");
+        }
+
+        $session->free();
     }
 
     static function setSaveHandler()