aboutsummaryrefslogtreecommitdiffstats
path: root/include/queue_fn.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2017-11-01 12:08:59 +0100
committerMario Vavti <mario@mariovavti.com>2017-11-01 12:08:59 +0100
commit11cdc36bcc7414002c2e72fd0c45d285d9515f0c (patch)
treeffcb15dd536800b67c9918756e41bb4accde3320 /include/queue_fn.php
parentb28ff509b1f7c95ac723fb1b2a20929da2ba7d3d (diff)
parent22d45a8d1ecfa0a0a2b8429ec3233e7099e84b66 (diff)
downloadvolse-hubzilla-11cdc36bcc7414002c2e72fd0c45d285d9515f0c.tar.gz
volse-hubzilla-11cdc36bcc7414002c2e72fd0c45d285d9515f0c.tar.bz2
volse-hubzilla-11cdc36bcc7414002c2e72fd0c45d285d9515f0c.zip
Merge remote-tracking branch 'mike/master' into dev
Diffstat (limited to 'include/queue_fn.php')
-rw-r--r--include/queue_fn.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/queue_fn.php b/include/queue_fn.php
index c9179b953..c09033d0a 100644
--- a/include/queue_fn.php
+++ b/include/queue_fn.php
@@ -158,6 +158,16 @@ function queue_deliver($outq, $immediate = false) {
}
}
+ if($immediate) {
+ $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))) {
+ logger('immediate delivery deferred.', LOGGER_DEBUG, LOG_INFO);
+ update_queue_item($outq['outq_hash']);
+ return;
+ }
+ }
+
+
$arr = array('outq' => $outq, 'base' => $base, 'handled' => false, 'immediate' => $immediate);
call_hooks('queue_deliver',$arr);
if($arr['handled'])
@@ -205,7 +215,7 @@ function queue_deliver($outq, $immediate = false) {
else {
logger('deliver: queue post returned ' . $result['return_code']
. ' from ' . $outq['outq_posturl'],LOGGER_DEBUG);
- update_queue_item($outq['outq_posturl']);
+ update_queue_item($outq['outq_hash']);
}
return;
}