aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2017-11-03 10:48:00 +0100
committerMario Vavti <mario@mariovavti.com>2017-11-03 10:48:00 +0100
commit41749f5eda09bb22a57c833b3e9352507325ce27 (patch)
tree28ab99695e06b74fab0a25d9a8a2d16d800d7d4a /include
parent1567b7b383c56eec5998450a3b709963d5026570 (diff)
parente70bd0054c4ffb8aadeec8ee7c14dccdb34ab934 (diff)
downloadvolse-hubzilla-41749f5eda09bb22a57c833b3e9352507325ce27.tar.gz
volse-hubzilla-41749f5eda09bb22a57c833b3e9352507325ce27.tar.bz2
volse-hubzilla-41749f5eda09bb22a57c833b3e9352507325ce27.zip
Merge remote-tracking branch 'mike/master' into dev
Diffstat (limited to 'include')
-rw-r--r--include/network.php9
-rw-r--r--include/queue_fn.php7
2 files changed, 11 insertions, 5 deletions
diff --git a/include/network.php b/include/network.php
index 73a6aeff2..2caf29ab5 100644
--- a/include/network.php
+++ b/include/network.php
@@ -1433,14 +1433,19 @@ function scrape_feed($url) {
-function do_delivery($deliveries) {
+
+
+function do_delivery($deliveries, $force = false) {
+
+ // $force is set if a site that wasn't responding suddenly returns to life.
+ // Try and shove through everything going to that site while it's responding.
if(! (is_array($deliveries) && count($deliveries)))
return;
$x = q("select count(outq_hash) as total from outq where outq_delivered = 0");
- if(intval($x[0]['total']) > intval(get_config('system','force_queue_threshold',300))) {
+ if(intval($x[0]['total']) > intval(get_config('system','force_queue_threshold',300)) && (! $force)) {
logger('immediate delivery deferred.', LOGGER_DEBUG, LOG_INFO);
foreach($deliveries as $d) {
update_queue_item($d);
diff --git a/include/queue_fn.php b/include/queue_fn.php
index 0d98e1e21..5fb0d5f1e 100644
--- a/include/queue_fn.php
+++ b/include/queue_fn.php
@@ -42,7 +42,7 @@ function update_queue_item($id, $add_priority = 0) {
$next = datetime_convert('UTC','UTC','now + 1 hour');
}
else {
- $next = datetime_convert('UTC','UTC','now + 15 minutes');
+ $next = datetime_convert('UTC','UTC','now + ' . intval($add_priority) . ' minutes');
}
q("UPDATE outq SET outq_updated = '%s',
@@ -200,14 +200,15 @@ function queue_deliver($outq, $immediate = false) {
}
}
if($piled_up) {
- do_delivery($piled_up);
+ // call do_delivery() with the force flag
+ do_delivery($piled_up, true);
}
}
}
else {
logger('deliver: queue post returned ' . $result['return_code']
. ' from ' . $outq['outq_posturl'],LOGGER_DEBUG);
- update_queue_item($outq['outq_hash']);
+ update_queue_item($outq['outq_hash'],10);
}
return;
}