summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2019-10-15 11:56:27 +0200
committerJulius Härtl <jus@bitgrid.net>2019-10-15 15:17:16 +0200
commitee743867d4ad6b0e029c2f49999f84a94f585d87 (patch)
treea09bebabd626530026cf1bd5e0f7a942251db109
parente51010b0f43320d68e05e3d69a0d1d0ce45ca69e (diff)
downloadnextcloud-server-ee743867d4ad6b0e029c2f49999f84a94f585d87.tar.gz
nextcloud-server-ee743867d4ad6b0e029c2f49999f84a94f585d87.zip
Make sure the cache is only reset once at a time
Signed-off-by: Julius Härtl <jus@bitgrid.net>
-rw-r--r--lib/private/Template/SCSSCacher.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/Template/SCSSCacher.php b/lib/private/Template/SCSSCacher.php
index 1ddb4ff59dd..c6d5fc8ef71 100644
--- a/lib/private/Template/SCSSCacher.php
+++ b/lib/private/Template/SCSSCacher.php
@@ -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');
}
/**