From 35a9b49ed06c58b53f81cf5ef476191807157925 Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Fri, 15 Oct 2010 04:20:42 -0700 Subject: allow for multiple pubsub hubs so everything can still work when/if one goes flaky (Google's hub has been particularly unreliable recently and the symptoms are that you just stop receiving updates, and/or updates you send are silently dropped and never delivered). Also add more instrumentation to help debug pubsub issues. --- include/poller.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'include/poller.php') diff --git a/include/poller.php b/include/poller.php index bf2803b63..bb82e5eda 100644 --- a/include/poller.php +++ b/include/poller.php @@ -22,7 +22,7 @@ $a->set_baseurl(get_config('system','url')); $contacts = q("SELECT * FROM `contact` - WHERE ( `dfrn-id` != '' OR (`issued-id` != '' AND `duplex` = 1)) + WHERE `network` = 'dfrn' AND ( `dfrn-id` != '' OR (`issued-id` != '' AND `duplex` = 1)) AND `self` = 0 AND `blocked` = 0 AND `readonly` = 0 ORDER BY RAND()"); if(! count($contacts)) @@ -174,7 +174,15 @@ if((strlen($hub)) && ($contact['rel'] == REL_BUD) && ($contact['priority'] == 0)) { - subscribe_to_hub($hub,$importer,$contact); + $hubs = explode(',', $hub); + if(count($hubs)) { + foreach($hubs as $h) { + $h = trim($h); + if(! strlen($h)) + continue; + subscribe_to_hub($h,$importer,$contact); + } + } } -- cgit v1.2.3