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:
Roeland Jago Douma 2017-10-25 08:29:28 +02:00
parent c85deacddb
commit 88cba6d882
No known key found for this signature in database
GPG Key ID: F941078878347C0C
1 changed files with 2 additions and 2 deletions

View File

@ -532,8 +532,8 @@ class Server extends ServerContainer implements IServerContainer {
$this->registerService(\OCP\Route\IRouter::class, function (Server $c) {
$cacheFactory = $c->getMemCacheFactory();
$logger = $c->getLogger();
if ($cacheFactory->isAvailable()) {
$router = new \OC\Route\CachingRouter($cacheFactory->create('route'), $logger);
if ($cacheFactory->isAvailableLowLatency()) {
$router = new \OC\Route\CachingRouter($cacheFactory->createLocal('route'), $logger);
} else {
$router = new \OC\Route\Router($logger);
}