From bc6d5e5e88bc9be188bbf047c3746ff681fd48e5 Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Thu, 20 May 2021 14:43:33 +0200 Subject: [PATCH] add better url cache cleaner method --- core/Cache/SymfonyCacheManager.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/Cache/SymfonyCacheManager.php b/core/Cache/SymfonyCacheManager.php index f204392..f296142 100644 --- a/core/Cache/SymfonyCacheManager.php +++ b/core/Cache/SymfonyCacheManager.php @@ -9,6 +9,7 @@ use Symfony\Component\Finder\Finder; use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Contracts\HttpClient\HttpClientInterface; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; +use Symfony\Component\HttpClient\Exception\ClientException; /** * class SymfonyCacheManager. @@ -43,8 +44,11 @@ class SymfonyCacheManager unlink((string) $file->getPathname()); } - // Hack: used to regenerate cache of url generator - $this->httpClient->request('POST', $pingUrl); + try { + // Hack: used to regenerate cache of url generator + $this->httpClient->request('POST', $pingUrl); + } catch (ClientException $e) { + } } public function cleanAll()