diff options
Diffstat (limited to 'include')
-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; } |