Skip to content

Commit

Permalink
Don't cache groups
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Oct 14, 2017
1 parent bb8ca52 commit 202d075
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/Util/EntityFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,18 @@ public function remove($key) {
*
* @throws Exception
*/
protected function cached($key, $cache, $callable) {
private function cached($key, $cache, $callable) {
if ($cache && $this->cache->contains($key)) {
return $this->cache->fetch($key);
$entity = $this->cache->fetch($key);

if ($entity->getType() !== 'group') {
return $entity;
}
}

$entity = $callable();

if (isset($entity) && $cache) {
if (isset($entity) && $cache && $entity->getType() !== 'group') {
if (!isset($this->ttl)) {
$this->ttl = Util\Configuration::read('cache.ttl', 3600);
}
Expand Down

0 comments on commit 202d075

Please sign in to comment.