add better url cache cleaner method

This commit is contained in:
Simon Vieille 2021-05-20 14:43:33 +02:00
parent a67054f2a8
commit bc6d5e5e88

View file

@ -9,6 +9,7 @@ use Symfony\Component\Finder\Finder;
use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface; use Symfony\Contracts\HttpClient\HttpClientInterface;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\HttpClient\Exception\ClientException;
/** /**
* class SymfonyCacheManager. * class SymfonyCacheManager.
@ -43,8 +44,11 @@ class SymfonyCacheManager
unlink((string) $file->getPathname()); unlink((string) $file->getPathname());
} }
try {
// Hack: used to regenerate cache of url generator // Hack: used to regenerate cache of url generator
$this->httpClient->request('POST', $pingUrl); $this->httpClient->request('POST', $pingUrl);
} catch (ClientException $e) {
}
} }
public function cleanAll() public function cleanAll()