From 1e3d74a9cfdaf708632a97660e1811dd819f7df4 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Thu, 20 Oct 2016 21:17:03 +0200 Subject: [PATCH] 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. --- src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 { -- 2.41.0