]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Avoid RabbitMQ consumer to loop
authorJeremy Benoist <jeremy.benoist@gmail.com>
Thu, 20 Oct 2016 19:17:03 +0000 (21:17 +0200)
committerJeremy Benoist <jeremy.benoist@gmail.com>
Thu, 20 Oct 2016 19:17:03 +0000 (21:17 +0200)
When the `parseEntry` returns null it means the entry already exists in the database. Sending `false` as return, will requeue the message which will then loop forever.

src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php

index 2b85ad7672324b31f90a68d27da3022469841436..b893ea2956bdb2c07b73a7e518519735d9904b84 100644 (file)
@@ -50,9 +50,10 @@ abstract class AbstractConsumer
         $entry = $this->import->parseEntry($storedEntry);
 
         if (null === $entry) {
-            $this->logger->warning('Unable to parse entry', ['entry' => $storedEntry]);
+            $this->logger->warning('Entry already exists', ['entry' => $storedEntry]);
 
-            return false;
+            // return true to skip message
+            return true;
         }
 
         try {