]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/ImportBundle/Consumer/AMPQ/EntryConsumer.php
Fix DateTime & clear()
[github/wallabag/wallabag.git] / src / Wallabag / ImportBundle / Consumer / AMPQ / EntryConsumer.php
index 8a8cf45d92fdf97de998421aa1954533ad3f1b61..72a3260a432542560e1b5b9ce964640c3d21afa9 100644 (file)
@@ -7,6 +7,8 @@ use OldSound\RabbitMqBundle\RabbitMq\ConsumerInterface;
 use PhpAmqpLib\Message\AMQPMessage;
 use Wallabag\ImportBundle\Import\AbstractImport;
 use Wallabag\UserBundle\Repository\UserRepository;
+use Wallabag\CoreBundle\Entity\Entry;
+use Wallabag\CoreBundle\Entity\Tag;
 use Psr\Log\LoggerInterface;
 use Psr\Log\NullLogger;
 
@@ -53,7 +55,10 @@ class EntryConsumer implements ConsumerInterface
 
         try {
             $this->em->flush();
-            $this->em->clear($entry);
+
+            // clear only affected entities
+            $this->em->clear(Entry::class);
+            $this->em->clear(Tag::class);
         } catch (\Exception $e) {
             $this->logger->warning('Unable to save entry', ['entry' => $storedEntry, 'exception' => $e]);