]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Import: we now skip messages when user is null 2915/head
authorNicolas Lœuillet <nicolas@loeuillet.org>
Mon, 20 Feb 2017 08:16:02 +0000 (09:16 +0100)
committerNicolas Lœuillet <nicolas@loeuillet.org>
Mon, 20 Feb 2017 08:16:02 +0000 (09:16 +0100)
src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php
tests/Wallabag/ImportBundle/Consumer/AMQPEntryConsumerTest.php
tests/Wallabag/ImportBundle/Consumer/RedisEntryConsumerTest.php

index fc175f671b466b8370dbd7e6ea0878358b9d6873..992ce1adba3a7a3ba526eb1a6eec876e4c2a9c1b 100644 (file)
@@ -46,7 +46,8 @@ abstract class AbstractConsumer
         if (null === $user) {
             $this->logger->warning('Unable to retrieve user', ['entry' => $storedEntry]);
 
-            return false;
+            // return true to skip message
+            return true;
         }
 
         $this->import->setUser($user);
index 856954a64660e06fe07ede8b74f397478122e96d..a989ec7fd9b4a8c8abb5dbbed7e48dfe80afe5e0 100644 (file)
@@ -183,7 +183,9 @@ JSON;
 
         $message = new AMQPMessage($body);
 
-        $consumer->execute($message);
+        $res = $consumer->execute($message);
+
+        $this->assertTrue($res);
     }
 
     public function testMessageWithEntryProcessed()
index 3b92f7596d59edd2fa22473dcf7b16f4fad0b2ff..78bd83ba32344b382e3bab8eb7c21258cde4856c 100644 (file)
@@ -182,7 +182,7 @@ JSON;
 
         $res = $consumer->manage($body);
 
-        $this->assertFalse($res);
+        $this->assertTrue($res);
     }
 
     public function testMessageWithEntryProcessed()