From 406a1c5f7284a7496948a6bacf19025cbe2b4ae4 Mon Sep 17 00:00:00 2001 From: Jules Pietri Date: Thu, 16 Nov 2023 10:48:28 +0100 Subject: [PATCH] Fix clearing cache --- src/CacheWarmer/SerializerCacheWarmer.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/CacheWarmer/SerializerCacheWarmer.php b/src/CacheWarmer/SerializerCacheWarmer.php index 0f9e3d66..c077e433 100644 --- a/src/CacheWarmer/SerializerCacheWarmer.php +++ b/src/CacheWarmer/SerializerCacheWarmer.php @@ -40,7 +40,10 @@ public function __construct(array $paths, array $profiles, HTMLPurifiersRegistry public function warmUp($cacheDir): array { foreach ($this->paths as $path) { - $this->filesystem->remove($path); // clean previous cache + if ($this->filesystem->exists($path)) { + $this->filesystem->remove($path); // clean previous cache + } + $this->filesystem->mkdir($path); }