]> git.mxchange.org Git - friendica.git/blobdiff - include/queue.php
Merge branch 'master' of git://github.com/friendika/friendika
[friendica.git] / include / queue.php
index cc36b2f62542da7c3014dcbd6bdf93356821bcfb..fb65d5c25bcbaf88e91815a98c2f9a11259a0473 100644 (file)
@@ -22,8 +22,13 @@ function queue_run($argv, $argc){
        require_once('include/items.php');
        require_once('include/bbcode.php');
 
+       load_config('config');
+       load_config('system');
+
        $a->set_baseurl(get_config('system','url'));
 
+       load_hooks();
+
        $deadguys = array();
 
        logger('queue: start');
@@ -53,7 +58,11 @@ function queue_run($argv, $argc){
        require_once('include/salmon.php');
 
        foreach($r as $q_item) {
-               $qi = q("SELECT * FROM `queue` WHERE `id` = %d LIMIT 1",
+
+               // queue_predeliver hooks may have changed the queue db details, 
+               // so check again if this entry still needs processing
+
+               $qi = q("SELECT * FROM `queue` WHERE `id` = %d AND `last` < UTC_TIMESTAMP() - INTERVAL 15 MINUTE ",
                        intval($q_item['id'])
                );
                if(! count($qi))