Merge pull request #53453 from nextcloud/fix/do-not-cache-routes-on-debug-mode

fix(router): In debug mode, cache routes only for 3 seconds
This commit is contained in:
John Molakvoæ 2025-06-12 17:45:57 +02:00 committed by GitHub
commit 763873e152
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -80,7 +80,7 @@ class CachingRouter extends Router {
if (!$cachedRoutes) {
parent::loadRoutes();
$cachedRoutes = $this->serializeRouteCollection($this->root);
$this->cache->set($key, $cachedRoutes, 3600);
$this->cache->set($key, $cachedRoutes, ($this->config->getSystemValueBool('debug') ? 3 : 3600));
}
$matcher = new CompiledUrlMatcher($cachedRoutes, $this->context);
$this->eventLogger->start('cacheroute:url:match', 'Symfony URL match call');

View file

@ -53,7 +53,7 @@ class Router implements IRouter {
public function __construct(
protected LoggerInterface $logger,
IRequest $request,
private IConfig $config,
protected IConfig $config,
protected IEventLogger $eventLogger,
private ContainerInterface $container,
protected IAppManager $appManager,