temporary --skip-xmpp flag on queuedaemon.php, allows to run queue daemons but skip subscription to xmpp-based queues

(still working on making these behave gracefully when server is down)
This commit is contained in:
Brion Vibber 2010-01-14 15:32:37 -08:00
parent 5783874cc2
commit 58bc33850a
2 changed files with 6 additions and 2 deletions

View File

@ -157,7 +157,7 @@ abstract class QueueManager extends IoManager
} }
// XMPP output handlers... // XMPP output handlers...
if (common_config('xmpp', 'enabled')) { if (common_config('xmpp', 'enabled') && !defined('XMPP_EMERGENCY_FLAG')) {
$this->connect('jabber', 'JabberQueueHandler'); $this->connect('jabber', 'JabberQueueHandler');
$this->connect('public', 'PublicQueueHandler'); $this->connect('public', 'PublicQueueHandler');

View File

@ -21,7 +21,7 @@
define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); define('INSTALLDIR', realpath(dirname(__FILE__) . '/..'));
$shortoptions = 'fi:at:'; $shortoptions = 'fi:at:';
$longoptions = array('id=', 'foreground', 'all', 'threads='); $longoptions = array('id=', 'foreground', 'all', 'threads=', 'skip-xmpp');
/** /**
* Attempts to get a count of the processors available on the current system * Attempts to get a count of the processors available on the current system
@ -260,6 +260,10 @@ if (!$threads) {
$daemonize = !(have_option('f') || have_option('--foreground')); $daemonize = !(have_option('f') || have_option('--foreground'));
$all = have_option('a') || have_option('--all'); $all = have_option('a') || have_option('--all');
if (have_option('--skip-xmpp')) {
define('XMPP_EMERGENCY_FLAG', true);
}
$daemon = new QueueDaemon($id, $daemonize, $threads, $all); $daemon = new QueueDaemon($id, $daemonize, $threads, $all);
$daemon->runOnce(); $daemon->runOnce();