Skip to content
Snippets Groups Projects
Commit bb8fa72a authored by Fran Garcia-Linares's avatar Fran Garcia-Linares
Browse files

Formatting.

parent 697dd4ee
Branches
No related tags found
No related merge requests found
...@@ -17,7 +17,7 @@ class MemoryControlEventHandler implements EventSubscriberInterface { ...@@ -17,7 +17,7 @@ class MemoryControlEventHandler implements EventSubscriberInterface {
/** /**
* Keeps track of how many iterations will run until memory cache is flushed. * Keeps track of how many iterations will run until memory cache is flushed.
*/ */
protected int $iterationCountUntilCacheFlush = 100; protected int $iterationCountUntilCacheFlush = 1000;
public function __construct( public function __construct(
protected ConfigFactoryInterface $configFactory, protected ConfigFactoryInterface $configFactory,
...@@ -43,7 +43,7 @@ class MemoryControlEventHandler implements EventSubscriberInterface { ...@@ -43,7 +43,7 @@ class MemoryControlEventHandler implements EventSubscriberInterface {
public function reduceMemoryUsage(MigratePostRowSaveEvent $event): void { public function reduceMemoryUsage(MigratePostRowSaveEvent $event): void {
$this->iterationCountUntilCacheFlush--; $this->iterationCountUntilCacheFlush--;
if ($this->iterationCountUntilCacheFlush <= 0) { if ($this->iterationCountUntilCacheFlush <= 0) {
dump(round(memory_get_usage()/1048576,2). 'MB'); dump(round(memory_get_usage()/1048576,2). ' MB');
// @todo if below not needed then remove all class + service. // @todo if below not needed then remove all class + service.
// $this->memoryCache->deleteAll(); // $this->memoryCache->deleteAll();
// $this->configFactory->clearStaticCache(); // $this->configFactory->clearStaticCache();
...@@ -51,7 +51,7 @@ class MemoryControlEventHandler implements EventSubscriberInterface { ...@@ -51,7 +51,7 @@ class MemoryControlEventHandler implements EventSubscriberInterface {
// foreach ($this->entityTypeManager->getDefinitions() as $id => $definition) { // foreach ($this->entityTypeManager->getDefinitions() as $id => $definition) {
// $this->entityTypeManager->getStorage($id)->resetCache(); // $this->entityTypeManager->getStorage($id)->resetCache();
// } // }
$this->iterationCountUntilCacheFlush = 100; $this->iterationCountUntilCacheFlush = 1000;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment