Fix query cache.

This commit is contained in:
James Cole 2018-01-17 10:03:47 +01:00
parent 3ccb791674
commit 13df973873
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
2 changed files with 2 additions and 13 deletions

View File

@ -246,14 +246,13 @@ class JournalCollector implements JournalCollectorInterface
$this->run = true;
// find query set in cache.
$hash = hash('sha256', $this->query->toSql());
$hash = hash('sha256', $this->query->toSql() . serialize($this->query->getBindings()));
$key = 'query-' . substr($hash, -8);
$cache = new CacheProperties;
$cache->addProperty($key);
if ($cache->has()) {
Log::debug(sprintf('Return cache of query with ID "%s".', $key));
return $cache->get(); // @codeCoverageIgnore
//return $cache->get(); // @codeCoverageIgnore
}
/** @var Collection $set */
@ -299,14 +298,6 @@ class JournalCollector implements JournalCollectorInterface
return $journals;
}
/**
* @return EloquentBuilder
*/
public function getQuery(): EloquentBuilder
{
return $this->query;
}
/**
* @param string $filter
*

View File

@ -79,8 +79,6 @@ interface JournalCollectorInterface
*/
public function getPaginatedJournals(): LengthAwarePaginator;
public function getQuery(): EloquentBuilder;
/**
* @param string $filter
*