diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-04-13 14:46:31 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-04-18 14:48:18 +0200 |
commit | dc12084d933dc4981a6ff489622845053d4914b3 (patch) | |
tree | 9747cf4e425db3e7c7e5d0bbf79b0edb5c3f14fa | |
parent | 0907a72c6477cbe0f25a25563a9c37c43a28d5ad (diff) | |
download | wallabag-dc12084d933dc4981a6ff489622845053d4914b3.tar.gz wallabag-dc12084d933dc4981a6ff489622845053d4914b3.tar.zst wallabag-dc12084d933dc4981a6ff489622845053d4914b3.zip |
Add doctrine clear after flush, thanks to @BitOne talk at Symfony Live
-rw-r--r-- | src/Wallabag/ImportBundle/Import/PocketImport.php | 1 | ||||
-rw-r--r-- | src/Wallabag/ImportBundle/Import/WallabagImport.php | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php index f598e611..ac68b6d9 100644 --- a/src/Wallabag/ImportBundle/Import/PocketImport.php +++ b/src/Wallabag/ImportBundle/Import/PocketImport.php | |||
@@ -258,6 +258,7 @@ class PocketImport implements ImportInterface | |||
258 | // flush every 20 entries | 258 | // flush every 20 entries |
259 | if (($i % 20) === 0) { | 259 | if (($i % 20) === 0) { |
260 | $this->em->flush(); | 260 | $this->em->flush(); |
261 | $this->em->clear(); | ||
261 | } | 262 | } |
262 | ++$i; | 263 | ++$i; |
263 | } | 264 | } |
diff --git a/src/Wallabag/ImportBundle/Import/WallabagImport.php b/src/Wallabag/ImportBundle/Import/WallabagImport.php index d65bc530..b265f9f1 100644 --- a/src/Wallabag/ImportBundle/Import/WallabagImport.php +++ b/src/Wallabag/ImportBundle/Import/WallabagImport.php | |||
@@ -185,6 +185,7 @@ abstract class WallabagImport implements ImportInterface | |||
185 | // flush every 20 entries | 185 | // flush every 20 entries |
186 | if (($i % 20) === 0) { | 186 | if (($i % 20) === 0) { |
187 | $this->em->flush(); | 187 | $this->em->flush(); |
188 | $this->em->clear(); | ||
188 | } | 189 | } |
189 | ++$i; | 190 | ++$i; |
190 | } | 191 | } |