diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-09-09 10:12:25 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-09-11 21:58:55 +0200 |
commit | 8664069e1aa2fa89e17587308a03f2720c20327a (patch) | |
tree | 67c1bd1279548ded1a366aaf01fd0a187a8271ba /src/Wallabag/ImportBundle/Import | |
parent | 6d65c0a8b089d3caa6f8e20d7935a9fe2f87d926 (diff) | |
download | wallabag-8664069e1aa2fa89e17587308a03f2720c20327a.tar.gz wallabag-8664069e1aa2fa89e17587308a03f2720c20327a.tar.zst wallabag-8664069e1aa2fa89e17587308a03f2720c20327a.zip |
Fix DateTime & clear()
Diffstat (limited to 'src/Wallabag/ImportBundle/Import')
-rw-r--r-- | src/Wallabag/ImportBundle/Import/AbstractImport.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Wallabag/ImportBundle/Import/AbstractImport.php b/src/Wallabag/ImportBundle/Import/AbstractImport.php index 8610062d..39befa7b 100644 --- a/src/Wallabag/ImportBundle/Import/AbstractImport.php +++ b/src/Wallabag/ImportBundle/Import/AbstractImport.php | |||
@@ -7,6 +7,7 @@ use Psr\Log\NullLogger; | |||
7 | use Doctrine\ORM\EntityManager; | 7 | use Doctrine\ORM\EntityManager; |
8 | use Wallabag\CoreBundle\Helper\ContentProxy; | 8 | use Wallabag\CoreBundle\Helper\ContentProxy; |
9 | use Wallabag\CoreBundle\Entity\Entry; | 9 | use Wallabag\CoreBundle\Entity\Entry; |
10 | use Wallabag\CoreBundle\Entity\Tag; | ||
10 | use Wallabag\UserBundle\Entity\User; | 11 | use Wallabag\UserBundle\Entity\User; |
11 | use OldSound\RabbitMqBundle\RabbitMq\Producer; | 12 | use OldSound\RabbitMqBundle\RabbitMq\Producer; |
12 | 13 | ||
@@ -113,7 +114,10 @@ abstract class AbstractImport implements ImportInterface | |||
113 | // flush every 20 entries | 114 | // flush every 20 entries |
114 | if (($i % 20) === 0) { | 115 | if (($i % 20) === 0) { |
115 | $this->em->flush(); | 116 | $this->em->flush(); |
116 | $this->em->clear($entry); | 117 | |
118 | // clear only affected entities | ||
119 | $this->em->clear(Entry::class); | ||
120 | $this->em->clear(Tag::class); | ||
117 | } | 121 | } |
118 | ++$i; | 122 | ++$i; |
119 | } | 123 | } |