Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Make sure the cache is only reset once at a time
Signed-off-by: Julius Härtl <[email protected]>
  • Loading branch information
juliusknorr authored and Backportbot committed Oct 17, 2019
commit 8d68e9e323354650c9af346755fe7e5638449363
6 changes: 5 additions & 1 deletion lib/private/Template/SCSSCacher.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ private function isCached(string $fileNameCSS, string $app) {
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;
Expand Down Expand Up @@ -364,6 +364,9 @@ private function cache(string $path, string $fileNameCSS, string $fileNameSCSS,
* 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
Expand All @@ -381,6 +384,7 @@ public function resetCache() {
}
}
$this->logger->debug('SCSSCacher: css cache cleared!');
$this->lockingCache->remove('resetCache');
}

/**
Expand Down