Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-10-15 16:59:21 +0300
committerMorris Jobke <hey@morrisjobke.de>2020-10-16 19:28:54 +0300
commitafeafd91a45dc282641612907c6689c1b8b66bd2 (patch)
tree1c48b6434001bf905f52e4aa070134f52d7d3393 /lib
parent20043ac4014c97b36daaa7d834ce9cc4974b93c2 (diff)
Clear cached app config while waiting for the SCSSCache to finish processing the file
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/AppConfig.php10
-rw-r--r--lib/private/Server.php3
-rw-r--r--lib/private/Template/SCSSCacher.php8
3 files changed, 19 insertions, 2 deletions
diff --git a/lib/private/AppConfig.php b/lib/private/AppConfig.php
index e562870aa7f..1d4a9a5614b 100644
--- a/lib/private/AppConfig.php
+++ b/lib/private/AppConfig.php
@@ -342,4 +342,14 @@ class AppConfig implements IAppConfig {
$this->configLoaded = true;
}
+
+ /**
+ * Clear all the cached app config values
+ *
+ * WARNING: do not use this - this is only for usage with the SCSSCacher to
+ * clear the memory cache of the app config
+ */
+ public function clearCachedConfig() {
+ $this->configLoaded = false;
+ }
}
diff --git a/lib/private/Server.php b/lib/private/Server.php
index 400389177e4..928ce118c32 100644
--- a/lib/private/Server.php
+++ b/lib/private/Server.php
@@ -1096,7 +1096,8 @@ class Server extends ServerContainer implements IServerContainer {
\OC::$SERVERROOT,
$this->getMemCacheFactory(),
$c->query(IconsCacher::class),
- new TimeFactory()
+ new TimeFactory(),
+ $c->query(AppConfig::class)
);
});
$this->registerService(JSCombiner::class, function (Server $c) {
diff --git a/lib/private/Template/SCSSCacher.php b/lib/private/Template/SCSSCacher.php
index 9be8cb7b59d..a6c371fb715 100644
--- a/lib/private/Template/SCSSCacher.php
+++ b/lib/private/Template/SCSSCacher.php
@@ -33,6 +33,7 @@ use Leafo\ScssPhp\Compiler;
use Leafo\ScssPhp\Exception\ParserException;
use Leafo\ScssPhp\Formatter\Crunched;
use Leafo\ScssPhp\Formatter\Expanded;
+use OC\AppConfig;
use OC\Files\AppData\Factory;
use OC\Memcache\NullCache;
use OC\Template\IconsCacher;
@@ -89,6 +90,8 @@ class SCSSCacher {
/** @var IMemcache */
private $lockingCache;
+ /** @var AppConfig */
+ private $appConfig;
/**
* @param ILogger $logger
@@ -109,7 +112,8 @@ class SCSSCacher {
$serverRoot,
ICacheFactory $cacheFactory,
IconsCacher $iconsCacher,
- ITimeFactory $timeFactory) {
+ ITimeFactory $timeFactory,
+ AppConfig $appConfig) {
$this->logger = $logger;
$this->appData = $appDataFactory->get('css');
$this->urlGenerator = $urlGenerator;
@@ -126,6 +130,7 @@ class SCSSCacher {
$this->lockingCache = $lockingCache;
$this->iconsCacher = $iconsCacher;
$this->timeFactory = $timeFactory;
+ $this->appConfig = $appConfig;
}
/**
@@ -166,6 +171,7 @@ class SCSSCacher {
$retry = 0;
sleep(1);
while ($retry < 10) {
+ $this->appConfig->clearCachedConfig();
$this->logger->debug('SCSSCacher::process check in while loop follows', ['app' => 'scss_cacher']);
if (!$this->variablesChanged() && $this->isCached($fileNameCSS, $app)) {
// Inject icons vars css if any