]> git.mxchange.org Git - friendica.git/commitdiff
added spaces + some curly braces + some usage of dbm::is_result()
authorRoland Haeder <roland@mxchange.org>
Tue, 4 Apr 2017 17:48:13 +0000 (19:48 +0200)
committerRoland Häder <roland@mxchange.org>
Wed, 17 May 2017 13:08:15 +0000 (15:08 +0200)
Signed-off-by: Roland Haeder <roland@mxchange.org>
include/pgettext.php
include/queue.php

index 756905a43a1bfb760e4f7d5e29aaab3bbafcb701..f6f26a8cc4a13b90f8daea14b1ca664f6c8e2f10 100644 (file)
@@ -91,7 +91,6 @@ function pop_lang() {
        $lang = $a->langsave;
 }
 
        $lang = $a->langsave;
 }
 
-
 // l
 
 if (! function_exists('load_translation_table')) {
 // l
 
 if (! function_exists('load_translation_table')) {
index dbed4604735e7eaedf0b672f665c4e7d6ac8be4b..3b34ada7f4e88ffa0f990325b3d733acb49a9444 100644 (file)
@@ -2,15 +2,15 @@
 
 use Friendica\Core\Config;
 
 
 use Friendica\Core\Config;
 
-require_once('include/queue_fn.php');
-require_once('include/dfrn.php');
-require_once("include/datetime.php");
-require_once('include/items.php');
-require_once('include/bbcode.php');
-require_once('include/socgraph.php');
-require_once('include/cache.php');
-
-function queue_run(&$argv, &$argc){
+require_once 'include/queue_fn.php';
+require_once 'include/dfrn.php';
+require_once 'include/datetime.php';
+require_once 'include/items.php';
+require_once 'include/bbcode.php';
+require_once 'include/socgraph.php';
+require_once 'include/cache.php';
+
+function queue_run(&$argv, &$argc) {
        global $a;
 
        if ($argc > 1) {
        global $a;
 
        if ($argc > 1) {
@@ -29,6 +29,25 @@ function queue_run(&$argv, &$argc){
                // Handling the pubsubhubbub requests
                proc_run(PRIORITY_HIGH,'include/pubsubpublish.php');
 
                // Handling the pubsubhubbub requests
                proc_run(PRIORITY_HIGH,'include/pubsubpublish.php');
 
+               $interval = ((get_config('system','delivery_interval') === false) ? 2 : intval(get_config('system','delivery_interval')));
+
+               // If we are using the worker we don't need a delivery interval
+               /// @TODO To much get_config() here
+               if (get_config("system", "worker")) {
+                       $interval = false;
+               }
+
+               $r = q("select * from deliverq where 1");
+               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);
+                               }
+                       }
+               }
+
                $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");
                $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");
@@ -60,8 +79,8 @@ function queue_run(&$argv, &$argc){
 
        // delivering
 
 
        // delivering
 
-       require_once('include/salmon.php');
-       require_once('include/diaspora.php');
+       require_once 'include/salmon.php';
+       require_once 'include/diaspora.php';
 
        $r = q("SELECT * FROM `queue` WHERE `id` = %d LIMIT 1",
                intval($queue_id));
 
        $r = q("SELECT * FROM `queue` WHERE `id` = %d LIMIT 1",
                intval($queue_id));