forked from wallabag/wallabag
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.
This commit is contained in:
@ -50,9 +50,10 @@ abstract class AbstractConsumer
|
|||||||
$entry = $this->import->parseEntry($storedEntry);
|
$entry = $this->import->parseEntry($storedEntry);
|
||||||
|
|
||||||
if (null === $entry) {
|
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 {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user