From 6d055ce09ea516f115a7c21a59d11f9257ce0d9e Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 22 Jan 2010 13:49:05 -0800 Subject: [PATCH 1/2] Fix unqueuemanager for updated QueueHandler interface --- lib/unqueuemanager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/unqueuemanager.php b/lib/unqueuemanager.php index 5595eac052..785de7c8ce 100644 --- a/lib/unqueuemanager.php +++ b/lib/unqueuemanager.php @@ -47,7 +47,7 @@ class UnQueueManager extends QueueManager $handler = $this->getHandler($queue); if ($handler) { - $handler->handle_notice($notice); + $handler->handle($notice); } else { if (Event::handle('UnqueueHandleNotice', array(&$notice, $queue))) { throw new ServerException("UnQueueManager: Unknown queue: $queue"); From 71b3b9ee2be6973c3f55a59811ae103321c5abcc Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 22 Jan 2010 13:58:20 -0800 Subject: [PATCH 2/2] Consolidate PuSH publishing ping into a single POST for all feeds, and fix server response (if any on failure) to go to log instead of stdout. --- plugins/PubSubHubBub/PubSubHubBubPlugin.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/plugins/PubSubHubBub/PubSubHubBubPlugin.php b/plugins/PubSubHubBub/PubSubHubBubPlugin.php index 8286cd5489..ce6086df94 100644 --- a/plugins/PubSubHubBub/PubSubHubBubPlugin.php +++ b/plugins/PubSubHubBub/PubSubHubBubPlugin.php @@ -211,13 +211,20 @@ class PubSubHubBubPlugin extends Plugin 'format' => 'atom')); } } + $feeds = array_unique($feeds); - foreach (array_unique($feeds) as $feed) { - if (!$publisher->publish_update($feed)) { - common_log_line(LOG_WARNING, - $feed.' was not published to hub at '. - $this->hub.':'.$publisher->last_response()); - } + ob_start(); + $ok = $publisher->publish_update($feeds); + $push_last_response = ob_get_clean(); + + if (!$ok) { + common_log(LOG_WARNING, + 'Failure publishing ' . count($feeds) . ' feeds to hub at '. + $this->hub.': '.$push_last_response); + } else { + common_log(LOG_INFO, + 'Published ' . count($feeds) . ' feeds to hub at '. + $this->hub.': '.$push_last_response); } return true;