diff --git a/vendor/magento/framework/View/Asset/File.php b/vendor/magento/framework/View/Asset/File.php index 0f31ad9ef22f7..e359f1aa402a3 100644 --- a/vendor/magento/framework/View/Asset/File.php +++ b/vendor/magento/framework/View/Asset/File.php @@ -1,7 +1,7 @@ source->getContent($this); - if (false === $content) { - throw new File\NotFoundException("Unable to get content for '{$this->getPath()}'"); + $attempt = 0; + while ($attempt < self::MAX_READ_ATTEMPTS) { + $attempt++; + $content = trim($this->source->getContent($this)); + + if ($content) { + return $content; + } + + if ($attempt < self::MAX_READ_ATTEMPTS) { + usleep(random_int(10000, 1000000)); + } } - return $content; + + throw new File\NotFoundException( + sprintf( + "Unable to get content for '%s' after %d attempts.", + $this->getPath(), + self::MAX_READ_ATTEMPTS + ) + ); } /**