]> git.mxchange.org Git - friendica.git/commitdiff
Merge branch 'pull'
authorFriendika <info@friendika.com>
Mon, 29 Aug 2011 06:01:42 +0000 (23:01 -0700)
committerFriendika <info@friendika.com>
Mon, 29 Aug 2011 06:01:42 +0000 (23:01 -0700)
include/delivery.php
include/queue.php

index 4b85a9ad1f6ae95f804930ba3583bfc2b85fe7d0..5d81228ee47a9c26ba91beba1c92a101ca780b61 100644 (file)
@@ -37,6 +37,19 @@ function delivery_run($argv, $argc){
        $item_id    = intval($argv[2]);
        $contact_id = intval($argv[3]);
 
+       // Some other process may have delivered this item already.
+
+       $r = q("select * from deliverq where cmd = '%s' and item = %d and contact = %d limit 1",
+               dbesc($cmd),
+               dbesc($item_id),
+               dbesc($contact_id)
+       );
+       if(! count($r)) {
+               return;
+       }       
+
+       // It's ours to deliver. Remove it from the queue.
+
        q("delete from deliverq where cmd = '%s' and item = %d and contact = %d limit 1",
                dbesc($cmd),
                dbesc($item_id),
index 0cb6fcec219f17b7f5e9d552e930d586df767357..1ac1e7d48c6db3f000847977b6c69f1ef081bc20 100644 (file)
@@ -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");
@@ -42,7 +42,6 @@ function queue_run($argv, $argc){
        if(! $interval)
                $interval = 2;
 
-
        $r = q("select * from deliverq where 1");
        if(count($r)) {
                foreach($r as $rr) {