aboutsummaryrefslogtreecommitdiffstats
path: root/include/queue_fn.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-11-01 22:34:31 -0700
committerzotlabs <mike@macgirvin.com>2017-11-01 22:34:31 -0700
commitf23c8e7597b6d96639738d0180e8cb277682ce23 (patch)
treeffcb15dd536800b67c9918756e41bb4accde3320 /include/queue_fn.php
parente539a9e7bdd035f96d8e8406e3433d34d99435da (diff)
parent11cdc36bcc7414002c2e72fd0c45d285d9515f0c (diff)
downloadvolse-hubzilla-f23c8e7597b6d96639738d0180e8cb277682ce23.tar.gz
volse-hubzilla-f23c8e7597b6d96639738d0180e8cb277682ce23.tar.bz2
volse-hubzilla-f23c8e7597b6d96639738d0180e8cb277682ce23.zip
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into dev_merge
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;
}