Skip to content

Commit 441c962

Browse files
committed
Merge pull request #682 from LearningLocker/issue/cache
Disables cache for now on aggregation queries.
2 parents 31106d9 + 596ed3c commit 441c962

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

app/locker/repository/Query/EloquentQueryRepository.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,14 @@ public function aggregate(array $opts, array $pipeline) {
8383
];
8484

8585
$cache_key = sha1(json_encode($pipeline));
86-
$result = IlluminateCache::get($cache_key, function() use ($pipeline, $cache_key) {
86+
$create_cache = function () use ($pipeline, $cache_key) {
8787
$expiration = Carbon::now()->addMinutes(10);
8888
$result = Helpers::replaceHtmlEntity($this->db->statements->aggregate($pipeline), true);
8989
IlluminateCache::put($cache_key, $result, $expiration);
9090
return $result;
91-
});
91+
};
92+
//$result = IlluminateCache::get($cache_key, $create_cache);
93+
$result = $create_cache();
9294

9395
return $result;
9496
}

0 commit comments

Comments
 (0)