diff options
author | Sarven Capadisli <csarven@controlyourself.ca> | 2009-08-04 15:53:15 +0000 |
---|---|---|
committer | Sarven Capadisli <csarven@controlyourself.ca> | 2009-08-04 15:53:15 +0000 |
commit | d0a020dd4ea8d58bc8230ebcde22e54ad31894a8 (patch) | |
tree | c7d14f1e09bd46c72e577ca54645a7bab4a747e7 /classes/Session.php | |
parent | 5f3af3e121a7ff06f5961bb4158e0b777ce5b5c1 (diff) | |
parent | ffa1d662a759a729151f2444bdf759749d59045e (diff) |
Merge branch '0.8.x' of git@gitorious.org:laconica/mainline into 0.8.x
Diffstat (limited to 'classes/Session.php')
-rw-r--r-- | classes/Session.php | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/classes/Session.php b/classes/Session.php index ac80279c5..5ec509f5f 100644 --- a/classes/Session.php +++ b/classes/Session.php @@ -108,11 +108,24 @@ class Session extends Memcached_DataObject $epoch = common_sql_date(time() - $maxlifetime); + $ids = array(); + $session = new Session(); $session->whereAdd('modified < "'.$epoch.'"'); - $result = $session->delete(DB_DATAOBJECT_WHEREADD_ONLY); + $session->selectAdd(); + $session->selectAdd('id'); + + $session->find(); + + while ($session->fetch()) { + $ids[] = $session->id; + } + + $session->free(); - self::logdeb("garbage collection result = $result"); + foreach ($ids as $id) { + self::destroy($id); + } } static function setSaveHandler() |