aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-10-10 21:08:25 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-10-10 21:08:25 -0700
commitdcb7bc5e718292066ac85d0a7f81c00ef7235d2f (patch)
tree1889023174412a838ca8d56ed11a6c76c16db321
parent70bd7a6509f262a943912bbd904c92718f323f9c (diff)
downloadvolse-hubzilla-dcb7bc5e718292066ac85d0a7f81c00ef7235d2f.tar.gz
volse-hubzilla-dcb7bc5e718292066ac85d0a7f81c00ef7235d2f.tar.bz2
volse-hubzilla-dcb7bc5e718292066ac85d0a7f81c00ef7235d2f.zip
Use dual delivery when dealing with flaky hub, reduce poll to once/hour
-rw-r--r--include/poller.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/poller.php b/include/poller.php
index 57c4cacfb..b5a5f6258 100644
--- a/include/poller.php
+++ b/include/poller.php
@@ -30,7 +30,7 @@
foreach($contacts as $contact) {
- if($contact['priority']) {
+ if($contact['priority'] || $contact['subhub']) {
$update = false;
$t = $contact['last-update'];
@@ -54,6 +54,13 @@
break;
case 1:
default:
+
+ // if pubsub delivery is in effect, poll no more than once every hour.
+ // We shouldn't need to poll at all with pubsub, but the hub isn't
+ // always the most reliable postmaster... This way we still get the
+ // messages when the hub goes flaky, just perhaps a bit slower.
+ // At least it doesn't hurt to get them twice.
+
if(datetime_convert('UTC','UTC', 'now') > datetime_convert('UTC','UTC', $t . " + 1 hour"))
$update = true;
break;