From bac3ee95c96db10ed51a907f6f9b602a7c887c0f Mon Sep 17 00:00:00 2001 From: CiaranG Date: Thu, 16 Apr 2009 21:07:59 +0100 Subject: Abort the xmpp-related daemons immediately if xmpp is disabled in the config, otherwise they chew up *lots* of CPU doing nothing --- scripts/jabberqueuehandler.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'scripts/jabberqueuehandler.php') diff --git a/scripts/jabberqueuehandler.php b/scripts/jabberqueuehandler.php index 924fc4545..8b6e974c0 100755 --- a/scripts/jabberqueuehandler.php +++ b/scripts/jabberqueuehandler.php @@ -54,6 +54,13 @@ class JabberQueueHandler extends XmppQueueHandler } } +// Abort immediately if xmpp is not enabled, otherwise the daemon chews up +// lots of CPU trying to connect to unconfigured servers +if (common_config('xmpp','enabled')==false) { + print "Aborting daemon - xmpp is disabled\n"; + exit(); +} + ini_set("max_execution_time", "0"); ini_set("max_input_time", "0"); set_time_limit(0); @@ -63,4 +70,4 @@ $resource = ($argc > 1) ? $argv[1] : (common_config('xmpp','resource') . '-queue $handler = new JabberQueueHandler($resource); -$handler->runOnce(); \ No newline at end of file +$handler->runOnce(); -- cgit v1.2.3-54-g00ecf