X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fqueue.php;h=f36e7723cd209b14978bcb40cadddfaaafafd3e2;hb=87eb3d5ef268534e1c8fac9ed63dad4fb50989ee;hp=ad7079e959ebce2d3a767167bb69e7a0ce693f2b;hpb=1caa87dce654c25e24749211e746cf55a20dee9c;p=friendica.git diff --git a/include/queue.php b/include/queue.php index ad7079e959..f36e7723cd 100644 --- a/include/queue.php +++ b/include/queue.php @@ -58,20 +58,21 @@ function queue_run(&$argv, &$argc){ $interval = false; $r = q("select * from deliverq where 1"); - if($r) { - foreach($r as $rr) { + if ($r) { + foreach ($r as $rr) { logger('queue: deliverq'); proc_run(PRIORITY_HIGH,'include/delivery.php',$rr['cmd'],$rr['item'],$rr['contact']); - if($interval) - @time_sleep_until(microtime(true) + (float) $interval); + if($interval) { + time_sleep_until(microtime(true) + (float) $interval); + } } } $r = q("SELECT `queue`.*, `contact`.`name`, `contact`.`uid` FROM `queue` INNER JOIN `contact` ON `queue`.`cid` = `contact`.`id` WHERE `queue`.`created` < UTC_TIMESTAMP() - INTERVAL 3 DAY"); - if($r) { - foreach($r as $rr) { + if ($r) { + foreach ($r as $rr) { logger('Removing expired queue item for ' . $rr['name'] . ', uid=' . $rr['uid']); logger('Expired queue data :' . $rr['content'], LOGGER_DATA); } @@ -126,7 +127,7 @@ function queue_run(&$argv, &$argc){ $c = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1", intval($qi[0]['cid']) ); - if(! count($c)) { + if (! dbm::is_result($c)) { remove_queue_item($q_item['id']); continue; } @@ -156,7 +157,7 @@ function queue_run(&$argv, &$argc){ FROM `user` WHERE `uid` = %d LIMIT 1", intval($c[0]['uid']) ); - if(! count($u)) { + if (! dbm::is_result($u)) { remove_queue_item($q_item['id']); continue; } @@ -195,7 +196,7 @@ function queue_run(&$argv, &$argc){ case NETWORK_DIASPORA: if($contact['notify']) { logger('queue: diaspora_delivery: item '.$q_item['id'].' for '.$contact['name'].' <'.$contact['url'].'>'); - $deliver_status = diaspora::transmit($owner,$contact,$data,$public,true); + $deliver_status = Diaspora::transmit($owner,$contact,$data,$public,true); if($deliver_status == (-1)) { update_queue_time($q_item['id']);