From 34e8b25ceef890c0d1e41b75696b19e8b53db960 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sun, 2 Aug 2009 10:34:23 -0400 Subject: [PATCH] GC sessions one by one to make sure memcached gets cleared --- classes/Session.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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() -- 2.39.5