diff options
author | Julius Härtl <jus@bitgrid.net> | 2018-03-07 14:13:36 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2018-03-07 15:09:43 +0100 |
commit | 63e261b4446996d9ba42f09b1c1b17c98f34390f (patch) | |
tree | 826aadf76aaca43311af66d5834a662c7db78278 /lib/private/Template/JSCombiner.php | |
parent | f652c28b2105792908dc73a414ff21cc135a906d (diff) | |
download | nextcloud-server-63e261b4446996d9ba42f09b1c1b17c98f34390f.tar.gz nextcloud-server-63e261b4446996d9ba42f09b1c1b17c98f34390f.zip |
Actually clear cache values for all base urls
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'lib/private/Template/JSCombiner.php')
-rw-r--r-- | lib/private/Template/JSCombiner.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/private/Template/JSCombiner.php b/lib/private/Template/JSCombiner.php index bc548c22fd0..93683753899 100644 --- a/lib/private/Template/JSCombiner.php +++ b/lib/private/Template/JSCombiner.php @@ -30,6 +30,7 @@ use OCP\Files\IAppData; use OCP\Files\NotFoundException; use OCP\Files\NotPermittedException; use OCP\Files\SimpleFS\ISimpleFolder; +use OCP\ICacheFactory; use OCP\ILogger; use OCP\IURLGenerator; @@ -50,21 +51,25 @@ class JSCombiner { /** @var ILogger */ protected $logger; + /** @var ICacheFactory */ + private $cacheFactory; + /** * @param IAppData $appData * @param IURLGenerator $urlGenerator - * @param ICache $depsCache + * @param ICacheFactory $cacheFactory * @param SystemConfig $config * @param ILogger $logger */ public function __construct(IAppData $appData, IURLGenerator $urlGenerator, - ICache $depsCache, + ICacheFactory $cacheFactory, SystemConfig $config, ILogger $logger) { $this->appData = $appData; $this->urlGenerator = $urlGenerator; - $this->depsCache = $depsCache; + $this->cacheFactory = $cacheFactory; + $this->depsCache = $this->cacheFactory->createDistributed('JS-' . md5($this->urlGenerator->getBaseUrl())); $this->config = $config; $this->logger = $logger; } @@ -243,7 +248,7 @@ class JSCombiner { * @throws NotFoundException */ public function resetCache() { - $this->depsCache->clear(); + $this->cacheFactory->createDistributed('JS-')->clear(); $appDirectory = $this->appData->getDirectoryListing(); foreach ($appDirectory as $folder) { foreach ($folder->getDirectoryListing() as $file) { |