diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-10-20 21:17:03 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-10-20 21:17:03 +0200 |
commit | 1e3d74a9cfdaf708632a97660e1811dd819f7df4 (patch) | |
tree | b9de4dad6c4034219661e170f156b3ce76b069fe /src/Wallabag/ImportBundle | |
parent | 576d285ddf1c9b4c78124b90fb902d0a57dd2a00 (diff) | |
download | wallabag-1e3d74a9cfdaf708632a97660e1811dd819f7df4.tar.gz wallabag-1e3d74a9cfdaf708632a97660e1811dd819f7df4.tar.zst wallabag-1e3d74a9cfdaf708632a97660e1811dd819f7df4.zip |
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.
Diffstat (limited to 'src/Wallabag/ImportBundle')
-rw-r--r-- | src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php | 5 |
1 files 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 | |||
50 | $entry = $this->import->parseEntry($storedEntry); | 50 | $entry = $this->import->parseEntry($storedEntry); |
51 | 51 | ||
52 | if (null === $entry) { | 52 | if (null === $entry) { |
53 | $this->logger->warning('Unable to parse entry', ['entry' => $storedEntry]); | 53 | $this->logger->warning('Entry already exists', ['entry' => $storedEntry]); |
54 | 54 | ||
55 | return false; | 55 | // return true to skip message |
56 | return true; | ||
56 | } | 57 | } |
57 | 58 | ||
58 | try { | 59 | try { |