Skip to content

Commit e60e910

Browse files
committed
ACP2E-2631: Hidden directories in pub/media/catalog/product cause disk space issues
1 parent 789f1a4 commit e60e910

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

app/code/Magento/Catalog/Model/Product/Image.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -845,8 +845,6 @@ public function clearCache()
845845
// If the directory cannot be deleted, it is likely because it is not empty anymore due to lazy loading from
846846
// the storefront triggering new cache file creation.
847847
// This is expected behavior and is not a cause for concern. Deletable files were deleted as expected.
848-
// To avoid errors on the storefront, we wrap the deletion in a try/catch block and silently handle any
849-
// exceptions, allowing the process to continue smoothly.
850848
try {
851849
$this->_mediaDirectory->delete($directory);
852850
// phpcs:ignore Magento2.CodeAnalysis.EmptyBlock.DetectedCatch

app/code/Magento/Catalog/Test/Unit/Model/Product/ImageTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,8 +517,7 @@ public function testClearCache(): void
517517
/**
518518
* This test verifies that if the cache directory cannot be deleted because it is no longer empty (due to newly
519519
* cached files being created after the old ones were deleted), the cache clean method should handle the exception
520-
* and complete the clean. This is expected behavior and is not a cause for concern.
521-
* The test asserts that the cache cleaning process completes successfully even if the directory cannot be deleted.
520+
* and complete the clean successfully even if the directory cannot be deleted.
522521
*
523522
* @return void
524523
* @throws FileSystemException

0 commit comments

Comments
 (0)