Skip to content

Commit b91f3fe

Browse files
committed
MC-5926: Conflict of simultaneous write in Redis cache
- consolidate cache flush into method
1 parent 81f6051 commit b91f3fe

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

app/code/Magento/Deploy/Model/Filesystem.php

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,16 +139,12 @@ public function regenerateStatic(
139139
]
140140
);
141141

142-
// Cache flush will regenerate needed folders structure for compilation and deploy that were deleted previously
143-
$cmd = $this->functionCallPath . 'cache:flush ';
144-
$this->shell->execute($cmd);
142+
$this->reinitCacheDirectories();
145143

146144
// Trigger code generation
147145
$this->compile($output);
148146

149-
// Cache flush will regenerate needed folders structure for compilation and deploy that were deleted previously
150-
$cmd = $this->functionCallPath . 'cache:flush ';
151-
$this->shell->execute($cmd);
147+
$this->reinitCacheDirectories();
152148

153149
// Trigger static assets compilation and deployment
154150
$this->deployStaticContent($output);
@@ -344,4 +340,15 @@ public function lockStaticResources()
344340
self::PERMISSIONS_FILE
345341
);
346342
}
343+
344+
/**
345+
* Flush cache and restore the basic cache directories.
346+
*
347+
* @throws LocalizedException
348+
*/
349+
private function reinitCacheDirectories()
350+
{
351+
$command = $this->functionCallPath . 'cache:flush';
352+
$this->shell->execute($command);
353+
}
347354
}

0 commit comments

Comments
 (0)