Skip to content

Commit 12a9eac

Browse files
committed
ACP2E-1168: Static content deployment timed out or failed
1 parent 91549b9 commit 12a9eac

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

app/code/Magento/Deploy/Collector/Collector.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ public function collect()
9393
if ($file->getModule() && !$this->moduleManager->isEnabled($file->getModule())) {
9494
continue;
9595
}
96+
if (!$file->getFileName()) {
97+
continue;
98+
}
9699
$file->setDeployedFileName($this->fileNameResolver->resolve($file->getFileName()));
97100
$params = $this->getParams($file);
98101
$packagePath = "{$params['area']}/{$params['theme']}/{$params['locale']}";

app/code/Magento/Deploy/Package/Processor/PreProcessor/Css.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,12 @@ private function buildMap($packagePath, $filePath, $fullPath)
149149
$imports = [];
150150
$this->map[$fullPath] = [];
151151

152-
$content = $this->staticDir->readFile($this->minification->addMinifiedSign($fullPath));
152+
$tmpFilename = $this->minification->addMinifiedSign($fullPath);
153+
if ($this->staticDir->isReadable($tmpFilename)) {
154+
$content = $this->staticDir->readFile($tmpFilename);
155+
} else {
156+
$content = '';
157+
}
153158

154159
$callback = function ($matchContent) use ($packagePath, $filePath, &$imports) {
155160
if ($this->isLocal($matchContent['path'])) {

app/code/Magento/Deploy/Package/Processor/PreProcessor/Less.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ class Less implements ProcessorInterface
5959
*/
6060
private $map = [];
6161

62+
/**
63+
* @var array
64+
*/
65+
private $pFileCache = [];
66+
6267
/**
6368
* Less constructor
6469
*
@@ -132,6 +137,7 @@ private function hasOverrides(PackageFile $parentFile, Package $package)
132137
$currentPackageFiles = array_merge($package->getFilesByType('less'), $package->getFilesByType('css'));
133138

134139
foreach ($currentPackageFiles as $file) {
140+
$this->pFileCache = [];
135141
if ($this->inParentFiles($file->getDeployedFileName(), $parentFile->getFileName(), $map)) {
136142
return true;
137143
}
@@ -154,6 +160,10 @@ private function inParentFiles($fileName, $parentFile, $map)
154160
return true;
155161
} else {
156162
foreach ($map[$parentFile] as $pFile) {
163+
if (in_array($pFile, $this->pFileCache)) {
164+
continue;
165+
}
166+
$this->pFileCache[] = $pFile;
157167
if ($this->inParentFiles($fileName, $pFile, $map)) {
158168
return true;
159169
}

dev/tests/integration/testsuite/Magento/Deploy/DeployTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ private function assertCssFromChildTheme($actualRootCssContent)
240240
private function assertBundleSize($theme)
241241
{
242242
$expectedSize = $this->bundleConfig->getBundleFileMaxSize('frontend', $theme);
243-
$expectedSize *= 1.15;
243+
$expectedSize *= 1.2;
244244

245245
$iterator = $this->getDirectoryIterator("frontend/{$theme}/en_US/js/bundle");
246246
/** @var \SplFileInfo $file */

0 commit comments

Comments
 (0)