perf(cache): update CI4 to use cache's deleteMatching method

add missing locale to category_options cache name
This commit is contained in:
Yassine Doghri 2021-04-20 13:43:38 +00:00
commit 54b84f9684
No known key found for this signature in database
GPG key ID: 3E7F89498B960C9F
31 changed files with 483 additions and 557 deletions

View file

@ -14,7 +14,8 @@ class UserModel extends \Myth\Auth\Models\UserModel
public function getPodcastContributors($podcastId)
{
if (!($found = cache("podcast{$podcastId}_contributors"))) {
$cacheName = "podcast#{$podcastId}_contributors";
if (!($found = cache($cacheName))) {
$found = $this->select('users.*, auth_groups.name as podcast_role')
->join('podcasts_users', 'podcasts_users.user_id = users.id')
->join(
@ -24,7 +25,7 @@ class UserModel extends \Myth\Auth\Models\UserModel
->where('podcasts_users.podcast_id', $podcastId)
->findAll();
cache()->save("podcast{$podcastId}_contributors", $found, DECADE);
cache()->save($cacheName, $found, DECADE);
}
return $found;