From 00db57949fe3e26fd82fb710cdba288a72937e3f Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Thu, 6 Mar 2014 01:50:54 +0100 Subject: [PATCH] Always queue inbox distribution --- classes/Notice.php | 33 ++++++++++++++------------------- lib/default.php | 1 - 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/classes/Notice.php b/classes/Notice.php index c25f702989..808de55c2e 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -2071,28 +2071,23 @@ class Notice extends Managed_DataObject Inbox::insertNotice($this, $user->id); } - if (common_config('queue', 'inboxes')) { - // If there's a failure, we want to _force_ - // distribution at this point. + // If there's a failure, we want to _force_ + // distribution at this point. + try { + $qm = QueueManager::get(); + $qm->enqueue($this, 'distrib'); + } catch (Exception $e) { + // If the exception isn't transient, this + // may throw more exceptions as DQH does + // its own enqueueing. So, we ignore them! try { - $qm = QueueManager::get(); - $qm->enqueue($this, 'distrib'); + $handler = new DistribQueueHandler(); + $handler->handle($this); } catch (Exception $e) { - // If the exception isn't transient, this - // may throw more exceptions as DQH does - // its own enqueueing. So, we ignore them! - try { - $handler = new DistribQueueHandler(); - $handler->handle($this); - } catch (Exception $e) { - common_log(LOG_ERR, "emergency redistribution resulted in " . $e->getMessage()); - } - // Re-throw so somebody smarter can handle it. - throw $e; + common_log(LOG_ERR, "emergency redistribution resulted in " . $e->getMessage()); } - } else { - $handler = new DistribQueueHandler(); - $handler->handle($this); + // Re-throw so somebody smarter can handle it. + throw $e; } } diff --git a/lib/default.php b/lib/default.php index c5794565a3..878e7310d8 100644 --- a/lib/default.php +++ b/lib/default.php @@ -100,7 +100,6 @@ $default = 'softlimit' => '90%', // total size or % of memory_limit at which to restart queue threads gracefully 'spawndelay' => 1, // Wait at least N seconds between (re)spawns of child processes to avoid slamming the queue server with subscription startup '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 'breakout' => array(), // List queue specifiers to break out when using Stomp queue. // Default will share all queues for all sites within each group. // Specify as / or //,