GC sessions one by one to make sure memcached gets cleared

This commit is contained in:
Evan Prodromou 2009-08-02 10:34:23 -04:00
parent d5cc1357fd
commit 34e8b25cee

View 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()