From c8823fe954f70e74037c4358d30f81d76ee2ed7b Mon Sep 17 00:00:00 2001 From: Taylor Dondich Date: Mon, 9 Dec 2019 20:23:57 -0800 Subject: [PATCH] Update to ensure setting of cache entry for ee contents if cache does not have it stored. --- workflow/engine/methods/enterprise/enterprise.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/workflow/engine/methods/enterprise/enterprise.php b/workflow/engine/methods/enterprise/enterprise.php index b291e204c..890d80056 100644 --- a/workflow/engine/methods/enterprise/enterprise.php +++ b/workflow/engine/methods/enterprise/enterprise.php @@ -217,13 +217,17 @@ class enterprisePlugin extends PMPlugin { $cacheKey = config('system.workspace') . 'enterprise.ee'; // Fetch the value from cache. If not present, fetch from the filesystem. - $value = Cache::get($cacheKey, function () { + $value = Cache::get($cacheKey, function () use($cacheKey) { if (file_exists(PATH_DATA_SITE . "ee")) { - return trim(file_get_contents(PATH_DATA_SITE . "ee")); + $contents = trim(file_get_contents(PATH_DATA_SITE . "ee")); + // Store it in cache so it can be used in the future + Cache::forever($cacheKey, $contents); + return $contents; } else { return null; } }); + if ($value) { $this->systemAvailable = unserialize($value); } else {