forked from GNUsocial/gnu-social
Add $config['sessions']['gc_limit'] to limit how much work we do in each session GC; defaulting to killing 1000 sessions at a time.
This commit is contained in:
parent
73011e6344
commit
433ec21119
@ -156,6 +156,13 @@ class Session extends Memcached_DataObject
|
|||||||
$session->selectAdd();
|
$session->selectAdd();
|
||||||
$session->selectAdd('id');
|
$session->selectAdd('id');
|
||||||
|
|
||||||
|
$limit = common_config('sessions', 'gc_limit');
|
||||||
|
if ($limit > 0) {
|
||||||
|
// On large sites, too many sessions to expire
|
||||||
|
// at once will just result in failure.
|
||||||
|
$session->limit($limit);
|
||||||
|
}
|
||||||
|
|
||||||
$session->find();
|
$session->find();
|
||||||
|
|
||||||
while ($session->fetch()) {
|
while ($session->fetch()) {
|
||||||
|
@ -262,7 +262,8 @@ $default =
|
|||||||
array('type' => 'fulltext'),
|
array('type' => 'fulltext'),
|
||||||
'sessions' =>
|
'sessions' =>
|
||||||
array('handle' => false, // whether to handle sessions ourselves
|
array('handle' => false, // whether to handle sessions ourselves
|
||||||
'debug' => false), // debugging output for sessions
|
'debug' => false, // debugging output for sessions
|
||||||
|
'gc_limit' => 1000), // max sessions to expire at a time
|
||||||
'design' =>
|
'design' =>
|
||||||
array('backgroundcolor' => null, // null -> 'use theme default'
|
array('backgroundcolor' => null, // null -> 'use theme default'
|
||||||
'contentcolor' => null,
|
'contentcolor' => null,
|
||||||
|
Loading…
Reference in New Issue
Block a user