From: Evan Prodromou Date: Sun, 2 Aug 2009 14:34:23 +0000 (-0400) Subject: GC sessions one by one to make sure memcached gets cleared X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=34e8b25ceef890c0d1e41b75696b19e8b53db960;p=quix0rs-gnu-social.git GC sessions one by one to make sure memcached gets cleared --- diff --git a/classes/Session.php b/classes/Session.php index ac80279c5e..a92ce405b5 100644 --- a/classes/Session.php +++ b/classes/Session.php @@ -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()