correctly gc sessions
This commit is contained in:
parent
0333caf421
commit
eb5679b029
|
@ -106,14 +106,11 @@ class Session extends Memcached_DataObject
|
||||||
{
|
{
|
||||||
self::logdeb("garbage collection (maxlifetime = $maxlifetime)");
|
self::logdeb("garbage collection (maxlifetime = $maxlifetime)");
|
||||||
|
|
||||||
$epoch = time() - $maxlifetime;
|
$epoch = common_sql_date(time() - $maxlifetime);
|
||||||
|
|
||||||
$qry = 'DELETE FROM session ' .
|
|
||||||
'WHERE modified < "'.$epoch.'"';
|
|
||||||
|
|
||||||
$session = new Session();
|
$session = new Session();
|
||||||
|
$session->whereAdd('modified < "'.$epoch.'"');
|
||||||
$result = $session->query($qry);
|
$result = $session->delete(DB_DATAOBJECT_WHEREADD_ONLY);
|
||||||
|
|
||||||
self::logdeb("garbage collection result = $result");
|
self::logdeb("garbage collection result = $result");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user