GC sessions one by one to make sure memcached gets cleared
This commit is contained in:
parent
d5cc1357fd
commit
34e8b25cee
|
@ -110,11 +110,20 @@ class Session extends Memcached_DataObject
|
|||
|
||||
$session = new Session();
|
||||
$session->whereAdd('modified < "'.$epoch.'"');
|
||||
$result = $session->delete(DB_DATAOBJECT_WHEREADD_ONLY);
|
||||
|
||||
$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()
|
||||
{
|
||||
self::logdeb("setting save handlers");
|
||||
|
|
Loading…
Reference in New Issue
Block a user