Disable theme config cache when debug mode enabled

This commit is contained in:
Luke Towers 2019-07-08 16:25:25 -06:00 committed by GitHub
parent 23282bbaa6
commit 6f583b3920
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 4 deletions

View File

@ -340,10 +340,14 @@ class Theme
}
try {
$cacheKey = self::CONFIG_KEY.'::'.$this->getDirName();
$config = Cache::rememberForever($cacheKey, function() use ($path) {
return Yaml::parseFile($path);
});
if (Config::get('app.debug', false)) {
$config = Yaml::parseFile($path);
} else {
$cacheKey = self::CONFIG_KEY.'::'.$this->getDirName();
$config = Cache::rememberForever($cacheKey, function() use ($path) {
return Yaml::parseFile($path);
});
}
}
catch (Exception $ex) {
// Cache failed