]> git.mxchange.org Git - friendica.git/blobdiff - include/queue.php
Normalize App parameter declaration (doc-include folders, boot)
[friendica.git] / include / queue.php
index ad7079e959ebce2d3a767167bb69e7a0ce693f2b..f36e7723cd209b14978bcb40cadddfaaafafd3e2 100644 (file)
@@ -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']);