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:
Jeremy Benoist 2016-10-20 21:17:03 +02:00
parent 576d285ddf
commit 1e3d74a9cf
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C

View 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 {