mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fix query cache.
This commit is contained in:
parent
3ccb791674
commit
13df973873
@ -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
|
||||
*
|
||||
|
@ -79,8 +79,6 @@ interface JournalCollectorInterface
|
||||
*/
|
||||
public function getPaginatedJournals(): LengthAwarePaginator;
|
||||
|
||||
public function getQuery(): EloquentBuilder;
|
||||
|
||||
/**
|
||||
* @param string $filter
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user