diff options
author | zotlabs <mike@macgirvin.com> | 2017-10-31 15:41:44 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2017-10-31 15:41:44 -0700 |
commit | 6efef3922b9fe6864c0855e6407b77ca54af70c5 (patch) | |
tree | fee64bc9227b29a745546f1486b82a688480f963 /include/queue_fn.php | |
parent | caec565de57dd77f51e917a40370bd9bc7617c3f (diff) | |
download | volse-hubzilla-6efef3922b9fe6864c0855e6407b77ca54af70c5.tar.gz volse-hubzilla-6efef3922b9fe6864c0855e6407b77ca54af70c5.tar.bz2 volse-hubzilla-6efef3922b9fe6864c0855e6407b77ca54af70c5.zip |
add another delivery control parameter (force queue threshold)
Diffstat (limited to 'include/queue_fn.php')
-rw-r--r-- | include/queue_fn.php | 12 |
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; } |