Skip to content

Commit

Permalink
Adds an emergency switch so we can run inbox distribution at save tim…
Browse files Browse the repository at this point in the history
…e (bypassing 'distrib' queue)

Set $config['queue']['inboxes'] = false to do so
  • Loading branch information
bvibber committed Jan 28, 2010
1 parent c67cdd7 commit 3abfb45
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 7 additions & 3 deletions classes/Notice.php
Expand Up @@ -326,9 +326,13 @@ static function saveNew($profile_id, $content, $source, $options=null) {
# XXX: someone clever could prepend instead of clearing the cache
$notice->blowOnInsert();

$qm = QueueManager::get();

$qm->enqueue($notice, 'distrib');
if (common_config('queue', 'inboxes')) {
$qm = QueueManager::get();
$qm->enqueue($notice, 'distrib');
} else {
$handler = new DistribQueueHandler();
$handler->handle($notice);
}

return $notice;
}
Expand Down
1 change: 1 addition & 0 deletions lib/default.php
Expand Up @@ -87,6 +87,7 @@
'monitor' => null, // URL to monitor ping endpoint (work in progress)
'softlimit' => '90%', // total size or % of memory_limit at which to restart queue threads gracefully
'debug_memory' => false, // true to spit memory usage to log
'inboxes' => true, // true to do inbox distribution & output queueing from in background via 'distrib' queue
),
'license' =>
array('type' => 'cc', # can be 'cc', 'allrightsreserved', 'private'
Expand Down

0 comments on commit 3abfb45

Please sign in to comment.