Use local cache for the CachingRouter
There is no need to cache routes distributed. It even has the downside that the router might return different routes then the ones in the local routes.php files. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
c85deacddb
commit
88cba6d882
|
@ -532,8 +532,8 @@ class Server extends ServerContainer implements IServerContainer {
|
||||||
$this->registerService(\OCP\Route\IRouter::class, function (Server $c) {
|
$this->registerService(\OCP\Route\IRouter::class, function (Server $c) {
|
||||||
$cacheFactory = $c->getMemCacheFactory();
|
$cacheFactory = $c->getMemCacheFactory();
|
||||||
$logger = $c->getLogger();
|
$logger = $c->getLogger();
|
||||||
if ($cacheFactory->isAvailable()) {
|
if ($cacheFactory->isAvailableLowLatency()) {
|
||||||
$router = new \OC\Route\CachingRouter($cacheFactory->create('route'), $logger);
|
$router = new \OC\Route\CachingRouter($cacheFactory->createLocal('route'), $logger);
|
||||||
} else {
|
} else {
|
||||||
$router = new \OC\Route\Router($logger);
|
$router = new \OC\Route\Router($logger);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue