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 a3f492d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/Util/EntityFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,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 a3f492d

Please sign in to comment.