From 58bc33850ab615f21b4364aac8b8b7f74a95111d Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 14 Jan 2010 15:32:37 -0800 Subject: [PATCH] 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) --- lib/queuemanager.php | 2 +- scripts/queuedaemon.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/queuemanager.php b/lib/queuemanager.php index a98c0efffb..b98e57a1ff 100644 --- a/lib/queuemanager.php +++ b/lib/queuemanager.php @@ -157,7 +157,7 @@ abstract class QueueManager extends IoManager } // XMPP output handlers... - if (common_config('xmpp', 'enabled')) { + if (common_config('xmpp', 'enabled') && !defined('XMPP_EMERGENCY_FLAG')) { $this->connect('jabber', 'JabberQueueHandler'); $this->connect('public', 'PublicQueueHandler'); diff --git a/scripts/queuedaemon.php b/scripts/queuedaemon.php index 8ef364fe7b..f8bade39db 100755 --- a/scripts/queuedaemon.php +++ b/scripts/queuedaemon.php @@ -21,7 +21,7 @@ define('INSTALLDIR', realpath(dirname(__FILE__) . '/..')); $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 @@ -260,6 +260,10 @@ if (!$threads) { $daemonize = !(have_option('f') || have_option('--foreground')); $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->runOnce();