Router failure to write to redis should not cause a crash.
This commit is contained in:
parent
30d3ba6a0f
commit
0862121586
1 changed files with 7 additions and 1 deletions
|
|
@ -3,6 +3,7 @@
|
|||
namespace Benzine\Router;
|
||||
|
||||
use Cache\Adapter\Chain\CachePoolChain;
|
||||
use Cache\Adapter\Common\Exception\CachePoolException;
|
||||
use Doctrine\Common\Annotations\AnnotationReader;
|
||||
use Doctrine\Common\Annotations\AnnotationRegistry;
|
||||
use Monolog\Logger;
|
||||
|
|
@ -152,7 +153,12 @@ class Router
|
|||
->set($this->getRoutes())
|
||||
->expiresAfter($this->cacheTTL)
|
||||
;
|
||||
$this->cachePoolChain->save($routeItem);
|
||||
|
||||
try {
|
||||
$this->cachePoolChain->save($routeItem);
|
||||
}catch(CachePoolException $cachePoolException){
|
||||
$this->logger->critical($cachePoolException->getMessage());
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue