summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2019-10-17 10:03:08 +0200
committerGitHub <noreply@github.com>2019-10-17 10:03:08 +0200
commitbd5189f29fc5b4340298f98f2f7a49aa3a157131 (patch)
tree78e8248f70b47a90b83910ef03130f8b5df32332 /lib
parent07dffb6df6fbf019cc668c716a95cf9e94e49f04 (diff)
parentee743867d4ad6b0e029c2f49999f84a94f585d87 (diff)
downloadnextcloud-server-bd5189f29fc5b4340298f98f2f7a49aa3a157131.tar.gz
nextcloud-server-bd5189f29fc5b4340298f98f2f7a49aa3a157131.zip
Let SCSS cleanup only run once (#17543)
Let SCSS cleanup only run once
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Template/SCSSCacher.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/private/Template/SCSSCacher.php b/lib/private/Template/SCSSCacher.php
index 9bdaca3a674..c6d5fc8ef71 100644
--- a/lib/private/Template/SCSSCacher.php
+++ b/lib/private/Template/SCSSCacher.php
@@ -117,7 +117,7 @@ class SCSSCacher {
$this->serverRoot = $serverRoot;
$this->cacheFactory = $cacheFactory;
$this->depsCache = $cacheFactory->createDistributed('SCSS-deps-' . md5($this->urlGenerator->getBaseUrl()));
- $this->isCachedCache = $cacheFactory->createLocal('SCSS-cached-' . md5($this->urlGenerator->getBaseUrl()));
+ $this->isCachedCache = $cacheFactory->createDistributed('SCSS-cached-' . md5($this->urlGenerator->getBaseUrl()));
$lockingCache = $cacheFactory->createDistributed('SCSS-locks-' . md5($this->urlGenerator->getBaseUrl()));
if (!($lockingCache instanceof IMemcache)) {
$lockingCache = new NullCache();
@@ -269,8 +269,8 @@ class SCSSCacher {
private function variablesChanged(): bool {
$injectedVariables = $this->getInjectedVariables();
if ($this->config->getAppValue('core', 'theming.variables') !== md5($injectedVariables)) {
- $this->resetCache();
$this->config->setAppValue('core', 'theming.variables', md5($injectedVariables));
+ $this->resetCache();
return true;
}
return false;
@@ -364,6 +364,9 @@ class SCSSCacher {
* We need to regenerate all files when variables change
*/
public function resetCache() {
+ if (!$this->lockingCache->add('resetCache', 'locked!', 120)) {
+ return;
+ }
$this->injectedVariables = null;
// do not clear locks
@@ -381,6 +384,7 @@ class SCSSCacher {
}
}
$this->logger->debug('SCSSCacher: css cache cleared!');
+ $this->lockingCache->remove('resetCache');
}
/**