Skip to content
Snippets Groups Projects
Commit d39cdf59 authored by Ere Maijala's avatar Ere Maijala
Browse files

Fix caching of parsed search specs file.

parent 48e07fde
No related merge requests found
......@@ -83,14 +83,14 @@ class SearchSpecsReader
$local = Locator::getLocalConfigPath($filename);
// Generate cache key:
$key = $filename . '-' . filemtime($fullpath);
$cacheKey = $filename . '-' . filemtime($fullpath);
if (!empty($local)) {
$key .= '-local-' . filemtime($local);
$cacheKey .= '-local-' . filemtime($local);
}
$key = md5($key);
$cacheKey = md5($cacheKey);
// Generate data if not found in cache:
if (!$cache || !($results = $cache->getItem($key))) {
if (!$cache || !($results = $cache->getItem($cacheKey))) {
$results = Yaml::parse($fullpath);
if (!empty($local)) {
$localResults = Yaml::parse($local);
......@@ -99,7 +99,7 @@ class SearchSpecsReader
}
}
if ($cache) {
$cache->setItem($key, $results);
$cache->setItem($cacheKey, $results);
}
}
$this->searchSpecs[$filename] = $results;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment