diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-12-31 12:26:41 -0800 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-12-31 12:26:41 -0800 |
commit | 2cf4ac26fdde5da6a6845d6c0dd1bb485fee2706 (patch) | |
tree | 54c2bba6e3e57b3d43971722e1014bb4d53628be /include/queue_fn.php | |
parent | 5f61f57b2c1362d9fef8f0390c4095ec30aef382 (diff) | |
download | volse-hubzilla-2cf4ac26fdde5da6a6845d6c0dd1bb485fee2706.tar.gz volse-hubzilla-2cf4ac26fdde5da6a6845d6c0dd1bb485fee2706.tar.bz2 volse-hubzilla-2cf4ac26fdde5da6a6845d6c0dd1bb485fee2706.zip |
log API improvements and queue optimisation for singleton networks
Diffstat (limited to 'include/queue_fn.php')
-rw-r--r-- | include/queue_fn.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/queue_fn.php b/include/queue_fn.php index 92299a193..0708aab56 100644 --- a/include/queue_fn.php +++ b/include/queue_fn.php @@ -124,6 +124,26 @@ function queue_deliver($outq, $immediate = false) { dbesc($outq['outq_hash']) ); remove_queue_item($outq['outq_hash']); + + // server is responding - see if anything else is going to this destination and is piled up + // and try to send some more. We're relying on the fact that delivery_loop() results in an + // immediate delivery otherwise we could get into a queue loop. + + if(! $immediate) { + $x = q("select outq_hash from outq where outq_posturl = '%s' and outq_delivered = 0", + dbesc($outq['outq_posturl']) + ); + + $piled_up = array(); + if($x) { + foreach($x as $xx) { + $piled_up[] = $xx['outq_hash']; + } + } + if($piled_up) { + delivery_loop($piled_up); + } + } } else { logger('deliver: queue post returned ' . $result['return_code'] |