From 4b2c66f5578911ad94b749cda1a801701bf168b9 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 13 Jul 2023 22:06:21 -0600 Subject: [PATCH] Update Services, use zpopmin on predis --- app/Services/LikeService.php | 4 +--- app/Services/NetworkTimelineService.php | 4 +--- app/Services/PublicTimelineService.php | 4 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/app/Services/LikeService.php b/app/Services/LikeService.php index 34a2417d0..f0ea1ac57 100644 --- a/app/Services/LikeService.php +++ b/app/Services/LikeService.php @@ -24,9 +24,7 @@ class LikeService { public static function setAdd($profileId, $statusId) { if(self::setCount($profileId) > 400) { - if(config('database.redis.client') === 'phpredis') { - Redis::zpopmin(self::CACHE_SET_KEY . $profileId); - } + Redis::zpopmin(self::CACHE_SET_KEY . $profileId); } return Redis::zadd(self::CACHE_SET_KEY . $profileId, $statusId, $statusId); diff --git a/app/Services/NetworkTimelineService.php b/app/Services/NetworkTimelineService.php index 570899017..9aea47af4 100644 --- a/app/Services/NetworkTimelineService.php +++ b/app/Services/NetworkTimelineService.php @@ -49,9 +49,7 @@ class NetworkTimelineService public static function add($val) { if(self::count() > config('instance.timeline.network.cache_dropoff')) { - if(config('database.redis.client') === 'phpredis') { - Redis::zpopmin(self::CACHE_KEY); - } + Redis::zpopmin(self::CACHE_KEY); } return Redis::zadd(self::CACHE_KEY, $val, $val); diff --git a/app/Services/PublicTimelineService.php b/app/Services/PublicTimelineService.php index e1275065c..f2658e4b1 100644 --- a/app/Services/PublicTimelineService.php +++ b/app/Services/PublicTimelineService.php @@ -49,9 +49,7 @@ class PublicTimelineService { public static function add($val) { if(self::count() > 400) { - if(config('database.redis.client') === 'phpredis') { - Redis::zpopmin(self::CACHE_KEY); - } + Redis::zpopmin(self::CACHE_KEY); } return Redis::zadd(self::CACHE_KEY, $val, $val);