X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fqueue.php;h=d312b50f5a99fe778feee4563f4252098ca813cc;hb=e36bdd5c8901803996e8c24b05efebe03e5175c2;hp=0cb6fcec219f17b7f5e9d552e930d586df767357;hpb=846c4cea7c0e3868a63a187ee9a504a031b2a7e4;p=friendica.git diff --git a/include/queue.php b/include/queue.php index 0cb6fcec21..d312b50f5a 100644 --- a/include/queue.php +++ b/include/queue.php @@ -3,18 +3,18 @@ require_once("boot.php"); require_once('include/queue_fn.php'); function queue_run($argv, $argc){ - global $a, $db; + global $a, $db; - if(is_null($a)){ - $a = new App; - } + if(is_null($a)){ + $a = new App; + } - if(is_null($db)){ - @include(".htconfig.php"); - require_once("dba.php"); - $db = new dba($db_host, $db_user, $db_pass, $db_data); - unset($db_host, $db_user, $db_pass, $db_data); - }; + if(is_null($db)){ + @include(".htconfig.php"); + require_once("dba.php"); + $db = new dba($db_host, $db_user, $db_pass, $db_data); + unset($db_host, $db_user, $db_pass, $db_data); + }; require_once("session.php"); @@ -38,17 +38,15 @@ function queue_run($argv, $argc){ logger('queue: start'); - $interval = intval(get_config('system','delivery_interval')); - if(! $interval) - $interval = 2; - + $interval = ((get_config('system','delivery_interval') === false) ? 2 : intval(get_config('system','delivery_interval'))); $r = q("select * from deliverq where 1"); if(count($r)) { foreach($r as $rr) { logger('queue: deliverq'); proc_run('php','include/delivery.php',$rr['cmd'],$rr['item'],$rr['contact']); - @time_sleep_until(microtime(true) + (float) $interval); + if($interval) + @time_sleep_until(microtime(true) + (float) $interval); } } @@ -125,6 +123,7 @@ function queue_run($argv, $argc){ } $data = $qi[0]['content']; + $public = $qi[0]['batch']; $contact = $c[0]; $owner = $u[0]; @@ -157,7 +156,7 @@ function queue_run($argv, $argc){ case NETWORK_DIASPORA: if($contact['notify']) { logger('queue: diaspora_delivery: item ' . $q_item['id'] . ' for ' . $contact['name']); - $deliver_status = diaspora_transmit($owner,$contact,$data); + $deliver_status = diaspora_transmit($owner,$contact,$data,$public); if($deliver_status == (-1)) update_queue_time($q_item['id']);