Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupalorg_migrate
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupalorg_migrate
Commits
bb8fa72a
Commit
bb8fa72a
authored
11 months ago
by
Fran Garcia-Linares
Browse files
Options
Downloads
Patches
Plain Diff
Formatting.
parent
697dd4ee
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/EventSubscriber/MemoryControlEventHandler.php
+3
-3
3 additions, 3 deletions
src/EventSubscriber/MemoryControlEventHandler.php
with
3 additions
and
3 deletions
src/EventSubscriber/MemoryControlEventHandler.php
+
3
−
3
View file @
bb8fa72a
...
@@ -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
=
100
0
;
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
=
100
0
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment