From: Jeremy Benoist Date: Thu, 20 Oct 2016 19:17:03 +0000 (+0200) Subject: Avoid RabbitMQ consumer to loop X-Git-Tag: 2.1.3~25^2~5 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=1e3d74a9cfdaf708632a97660e1811dd819f7df4;hp=576d285ddf1c9b4c78124b90fb902d0a57dd2a00;p=github%2Fwallabag%2Fwallabag.git Avoid RabbitMQ consumer to loop 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. --- diff --git a/src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php b/src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php index 2b85ad76..b893ea29 100644 --- a/src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php +++ b/src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php @@ -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 {