Skip to content

Commit

Permalink
Make sure a tags method exists before calling it
Browse files Browse the repository at this point in the history
  • Loading branch information
nWidart committed Nov 20, 2017
1 parent 48df358 commit d654741
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Modules/Core/Repositories/Cache/BaseCacheDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,13 @@ protected function remember(\Closure $callback, $key = null)
{
$cacheKey = $this->makeCacheKey($key);

return $this->cache
->tags([$this->entityName, 'global'])
->remember($cacheKey, $this->cacheTime, $callback);
$store = $this->cache;

if (method_exists($this->cache->getStore(), 'tags')) {
$store = $store->tags([$this->entityName, 'global']);
}

return $store->remember($cacheKey, $this->cacheTime, $callback);
}

/**
Expand Down

0 comments on commit d654741

Please sign in to comment.